oakmac / chessboardjs

JavaScript chessboard
https://chessboardjs.com
MIT License
2k stars 406 forks source link

Guide to implement / use it in React #230

Closed coffeeDev98 closed 2 years ago

coffeeDev98 commented 2 years ago

Hi @oakmac,

Was wondering if there's a way to use this package in a React Typescript project as there are no current chessboard pacakges/wrappers that are as good.

Is it possible to guide me in this aspect?

Thanks!

oakmac commented 2 years ago

Was wondering if there's a way to use this package in a React Typescript project as there are no current chessboard packages/wrappers that are as good.

Yes - this should be possible. The tricky part will be coordinating the internal state of the chessboard.js widget with the state of a React component or application. How to accomplish this will be different for every project depending on the design of the application (ie: what do you want chessboard.js to do?) and how you are managing state in your React application (hooks, Redux, etc).

Is it possible to guide me in this aspect?

I am unable to offer custom assistance with chessboard.js integrations at this time.

I think it would be useful to have a React.js example integration on the examples page though. Could be a good project contribution for someone 😁