With useEffect I tried to compare the right sequence with the right clicks and if it is true, automatically redirect to another page. If you make a mistake four times you will be redirected to the Loose page, with each error remove an image. How do I redirect the pages and how do I delete the images as the click is false?
useEffect(() => {
const correctSequence = [4, 5, 7, 8, 9];
if (correctSequence === sequence) {<Redirect to="/Win" />;
} else {<Redirect to="/Loose" />;}
console.log(sequence);
console.log(correctSequence);}, [sequence]);
