Does anybody know why I get this error? I want to pass the setCookie function to ParseUserCookie but I get an error "Uncaught TypeError: Cannot read properties of undefined (reading 'setCookie')"
function TicTacToe(){
const [cookie, setCookie] = useState(null);
<button onClick={() => handleMultiplayerClick(setCookie)}>
.....
}
const handleMultiplayerClick = (props) => {
promptUserCookie();
let cookie = parseUserCookie(props.setCookie); //Cannot read properties
...
}
Uncaught TypeError: Cannot read properties of undefined (reading 'setCookie')
Via Active questions tagged javascript - Stack Overflow https://ift.tt/Jk789W3
Comments
Post a Comment