Closed hwkerr closed 3 years ago
Thank you very much! This fixes the issue #35 as well which was fixed using a workaround.
@hwkerr Going to be sometime before I can publish this to npm. I lost my activation codes for npm and cannot log in and publish the package. Not sure if there is a way forward at this point. I'm in communication with GitHub at the moment to try to resolve this
Fixes issue #65 where the board would not transition from the current position to the next positionFromProps if the previousPositionFromProps and next positionFromProps represented identical board positions.
Previously, getDerivedStateFromProps in ./src/Chessboard/index.js would only update the board state if
!isEqual(positionFromProps, currentPosition) && !isEqual(positionFromProps, previousPositionFromProps)
To help me better understand what was happening, I came up with these indexes to represent the different position instances used in the above conditional:
To fix the issue, I removed
!isEqual(positionFromProps, previousPositionFromProps)
from the conditional.