function Square(props){ const [user,setuser]=useState(props.xisNext); function handleclick(){ props.addPerson(props.id) } useEffect(()=>{ setuser(props.xisNext) }) return( <button onClick={handleclick} >{user[props.id]} </button> ) }
useEffect(() => { setuser(props.xisNext) }, [props.xisNext] );
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)