Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typescript support #7

Open
Razamindset opened this issue Dec 12, 2024 · 1 comment
Open

Add typescript support #7

Razamindset opened this issue Dec 12, 2024 · 1 comment

Comments

@Razamindset
Copy link

Hi there,

I really enjoy using this library—it’s fantastic! However, I noticed it lacks TypeScript support, which makes implementation a bit challenging. While integrating it into my React application, I struggled to identify the available props and understand which parameters can be passed to specific functions.

Adding TypeScript support would be a game-changer for developers like me. This is an amazing project—I can tell because I’ve previously implemented chessgroundjs in React with features like move validation and promotions, and it was quite a challenge!

Looking forward to seeing TypeScript support soon. Thanks for all your hard work!

@Razamindset
Copy link
Author

And one more thing I implemented the following and it shows a promotion dialog for no reason

import { NextChessground } from "next-chessground";
import { useEffect, useRef } from "react";

const Board = () => {
  const ref = useRef();

  useEffect(() => {
    if(ref.current){
        ref.current.board.move("d2", "d4")
    }
  
    return () => {
      
    }
  }, [])
  
  return (
    <div className="w-[400px]">
      <NextChessground ref={ref} />;
    </div>
  );
};

export default Board;

Please add more guidelines for contribuiting to this project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant