#On link change page does not rerender next js
1 messages · Page 1 of 1 (latest)
Based on the knowledge sources provided, there are several issues reported related to Next.js link changes and page re-rendering. Some users have reported that their pages do not re-render when changing routes using the Link component, while others have reported that their pages re-render too much, causing loss of state or other issues.
For instance, in this issue (https://github.com/vercel/next.js/issues/62520), a user reported that their page does not render when changing routes using the Link component. The issue was resolved by removing a rewrite rule in their vercel.json file.
In another issue (https://github.com/vercel/next.js/issues/49340), a user reported that the Link component causes a re-render of the root layout and all state is lost. This issue was reported in Next.js version > 13.3.0.
In yet another issue (https://github.com/vercel/next.js/issues/64882), a user reported that the Link component triggers a full root layout re-render in production build/static export.
If you're experiencing an issue where your page does not re-render when changing routes using the Link component, it could be due to a variety of factors, including your specific Next.js version, your application's configuration, or other factors. It would be helpful to provide more specific details about your issue, including any error messages you're seeing, the specific behavior you're observing, and any relevant code snippets.
If you're experiencing an issue where your page re-renders too much when changing routes using the Link component, you might want to consider using the shallow option with router.push or router.replace, which allows you to change the URL without running data fetching methods again. However, some users have reported that this does not always prevent re-renders.