-
Notifications
You must be signed in to change notification settings - Fork 69
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
Usage with react #20
Labels
Comments
Have not tried it, if you do, please report if it works. I think it should.... why not? |
it render board, but move, animation not work |
Can you provide a link to a testpage? |
change inputHandler. it work |
Okay,... nice... can you give more details? Thanks. |
use inputHandler like in example inputHandler = (event) => {
if (event.type === INPUT_EVENT_TYPE.moveDone) {
const move = {from: event.squareFrom, to: event.squareTo}
const result = this.game.move(move)
if (result) {
this.setState(() => ({
fen: this.game.fen(),
history: this.game.history({verbose: true}),
squareStyles: squareStyling({toSquare: event.squareTo, history: this.game.history({verbose: true})}),
}))
} else {
console.warn("invalid move", move)
}
return result
} else {
return true
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What about React. Can i use it?
The text was updated successfully, but these errors were encountered: