Replies: 1 comment
-
i was the same problem, and i fixed puting this is my mian layout.tsx import { revalidatePath } from 'next/cache'; https://nextjs.org/docs/app/api-reference/functions/revalidatePath |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
I have a page that renders server side. On that page is a series of links which will take the user to the same page but with new URL parameters. Think of it as a folder page that shows child folders. When the user clicks on one of those folders, it should populate the page's components with the new data.
The problem that I am having is that when a Link is clicked, the URL updates and getServerSideProps gets the new data. However, the page does not re render.
You can see the code on stack overflow.
https://stackoverflow.com/questions/75991442/next-js-clicking-link-on-page-prompts-getserversideprops-but-does-not-refresh-c
I feel like I am missing something. If the intent is for SSR pages to always behave this way, then they seem to negate the core use of react - updating components as opposed to reloading the whole page?
Additional information
No response
Example
https://stackoverflow.com/questions/75991442/next-js-clicking-link-on-page-prompts-getserversideprops-but-does-not-refresh-c
Beta Was this translation helpful? Give feedback.
All reactions