Adding onStartDrag callback
I thought it would be useful to add an onStartDrag(square) prop that is called whenever the user initiates a drag for a piece. For example it would help with highlighting the available moves when a user grabs a piece. And maybe an onStopDrag too!
I tried to use allowDrag to achieve this effect but for some reason allowDrag is called many times after a piece is dropped. When I added logic to compute available moves and change squareStyles for those squares in the allowDrag function it ended up calling allowDrag even more times and crashing the component. So I guess allowDrag was not designed to be used this way and I don't really understand why it gets called so many times.
I would be happy to work on this issue since I use this library on a personal project : )
react-chessboard (that was made because this library is no longer maintained) has onPieceDragBegin and onPieceDragEnd
@Clariity Excellent! I will probably migrate my project over to use react-chessboard then.