I set useEffect for only the first time running the console.log("hello");. But when I click the Home link, the useEffect run many times. Why is that? How do I fix it?
https://codesandbox.io/s/relaxed-wildflower-updeh?file=/src/Home.js:95-298
const Home = () => {
useEffect(() => {
console.log("hello");
}, []);
return (
<div>
<h1>History</h1>
<Link to="/">Home</Link>
</div>
);
};