#Page not remounting on "Back Button" press on browser

1 messages · Page 1 of 1 (latest)

timid solstice
#

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.

vale oreBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

unique rain
#

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?