Hi I'm just wondering is there any feature in React.js that allows you block user from clicking on some part of app?
To be more clear I'm working on Tic tac toe app and I would like to block any other clicks to game field if someone wins.
After checkWinner function detects a win, winner is displayed above game field like this
and from now I would like to make that user can click only replay icon or return icon. nothing else.
Part of my checkWinner function in which I've tried to use e.stopPropagation()
function checkWinner(e){
//Horizontal check
for(let i=0;i<values.length;i++){
let xCount=0;
let oCount=0;
for(let j=0;j<values[i].length;j++){
if(typeof values[i][j] === 'object' && values[i][j].props.children === 'x'){
xCount++;
}
if(typeof values[i][j] === 'object' && values[i][j].props.children === 'o'){
oCount++;
}
}
if(xCount === 3){
setWinner('X WINS!');
displayWinner();
e.stopPropagation();
}
}
This function is called after every click to field, so after every click it checks if someone wins. But this throws me an Error TypeError: Cannot read property 'stopPropagation' of undefined
Do you guys know about any other approach for this situation? Thanks.

checkWinner()?