next-chessground 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -6926,12 +6926,13 @@ const constants = {
|
|
|
6926
6926
|
|
|
6927
6927
|
const useChess = props => {
|
|
6928
6928
|
const [fen, setFen] = useState(props.fen || initialFen);
|
|
6929
|
-
const [chess] = useState(
|
|
6929
|
+
const [chess, setChess] = useState(new Chess(fen));
|
|
6930
6930
|
|
|
6931
6931
|
// reinitialize when FEN changes from props
|
|
6932
6932
|
useEffect(() => {
|
|
6933
6933
|
if (props.fen) {
|
|
6934
6934
|
setFen(props.fen);
|
|
6935
|
+
setChess(new Chess(props.fen));
|
|
6935
6936
|
setLastMove([]);
|
|
6936
6937
|
}
|
|
6937
6938
|
}, [props.fen, props.reset]);
|
package/dist/index.js
CHANGED
|
@@ -6935,12 +6935,13 @@ const constants = {
|
|
|
6935
6935
|
|
|
6936
6936
|
const useChess = props => {
|
|
6937
6937
|
const [fen, setFen] = React.useState(props.fen || initialFen);
|
|
6938
|
-
const [chess] = React.useState(
|
|
6938
|
+
const [chess, setChess] = React.useState(new Chess(fen));
|
|
6939
6939
|
|
|
6940
6940
|
// reinitialize when FEN changes from props
|
|
6941
6941
|
React.useEffect(() => {
|
|
6942
6942
|
if (props.fen) {
|
|
6943
6943
|
setFen(props.fen);
|
|
6944
|
+
setChess(new Chess(props.fen));
|
|
6944
6945
|
setLastMove([]);
|
|
6945
6946
|
}
|
|
6946
6947
|
}, [props.fen, props.reset]);
|