I created a stack structure here. As you can see, I made a timer with a Setinterval function in Home.js. The Setinterval function works in Home.js, but it continues to work