You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(see code below) I am Having trouble just doing simple things with react , I have a button set orientation and it set the value to black or white though I don't see any changes on the board?
also is there any more any more examples on this being used with react, I have working website www.chessonline.app
you can just sign up with anything@mail.com (you can register using a fake email and play one game) ,
I am trying to better the user experience
at the moment if you play and move a piece to the position and then goes back to where you moved it from and then loads were you moved it too,
I would like to try and implement this board as perhaps the drag and drop is smoother?
(see code below) I am Having trouble just doing simple things with react , I have a button set orientation and it set the value to black or white though I don't see any changes on the board?
also is there any more any more examples on this being used with react, I have working website www.chessonline.app
you can just sign up with anything@mail.com (you can register using a fake email and play one game) ,
I am trying to better the user experience
at the moment if you play and move a piece to the position and then goes back to where you moved it from and then loads were you moved it too,
I would like to try and implement this board as perhaps the drag and drop is smoother?
import React, { useState, useEffect} from 'react'
import { Chessboard } from "react-chessboard";
export default function ReactChessBoard() {
const[color, setColor] = useState("black");
//eslint-disable-next-line
const setBlackOrWhite = () => {
if(color === "white"){
setColor("black")
alert("set black")
}
return (
<button onClick={() => {setBlackOrWhite() }}>Flip Board
<Chessboard
boardWidth="600"
id="BasicBoard"
draggable-pieces
orientation={color === "white" ? 'black' : 'white'}
>
);
}
The text was updated successfully, but these errors were encountered: