#PageProps not getting updated on client side navigation

5 messages · Page 1 of 1 (latest)

thin bane
#

I noticed this behavior with my Nextjs app (ISR). let's say a user lands on the homepage, and then navigates to the about-us page(using Nextjs Link), on the first visit I can see a fetch request in the Network tab for the about-us page (about-us.json), but after that however many times the user change routes, that fetch call is not made again, this way unless the user does a full reload of the website, the user will not see the updated about-us page.
Updating the user's app without having the user reload the full website is a critical requirement for my SPA, how can I go about handling this situation?

barren tendon
#

I don’t really get what you are saying tbh. If you want to have the request on every page visit you can just use getServerSideProps right

thin bane
#

Hey @barren tendon thanks for the suggestion, here I have a 50 second long video explaining the exact issue, please look into this whenever you can spare a minute or two
https://www.youtube.com/watch?v=qCqiB8Kce9w

I noticed this behavior with my Nextjs app (ISR). let's say a user lands on the homepage, and then navigates to the about-us page(using Nextjs Link), on the first visit I can see a fetch request in the Network tab for the about-us page (about-us.json), but after that however many times the user change routes, that fetch call is not made again, t...

▶ Play video
barren tendon
#

Hey, ok clear now thank you. I think for these kinds of values you’d want to take a look to useSWR (swr.vercel.app) or react-query (does the same thing but is just different package).

#

Maybe you could cache bust the prefetch data but personally haven’t had / worked with this issue