Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const App = () => {
- let state = "fire";
- console.log(board_state)
- return(
- <div className="app">
- <Board board_state={state} />
- <SideBlock board_state={state} />
- </div>
- );
- }
- const ResetButton = (board_state) => {
- const [state, changeState] = React.useState();
- board_state = state;
- const resetState = () =>{
- changeState("water");
- console.log("hello")
- }
- return (<button style={{backgroundColor: "gray"}} className="resetBtn" board_state={board_state} onClick={resetState}> Reset </button>)
- }
- const SideBlock = ({board_state}) => {
- return (<div style={{marginLeft: "50px"}} className="sideBlock" board_state={board_state}>
- <ResetButton />
- </div>)
- }
Advertisement
Add Comment
Please, Sign In to add comment