Next.js Discord

Discord Forum

Page not remounting on "Back Button" press on browser

Unanswered
Northeast Congo Lion posted this in #help-forum
Open in Discord
Northeast Congo LionOP
I'm having a weird issue when back button is pressed in my Next.js app, the page doesn't remount and most of the components using useEffect freezes completely, especially sliders and carousels with framer motion, but gets to working on refreshing the page.

4 Replies

What if you were to put a search query and maybe log it inside of the use effect so you can include the query in the dependency array?
You need a way of something updating and being in the dependency array
But I'd like to know more about the issue. What is the use effect doing that it is important that it needs to re-render? Fetching data or changing state? Why is it important every navigation causes a re-render what is the goal?
Like all child components that use effect in any way are completely Frozen and broken? Or when you say Frozen, it's just not remounting and running the use effect?