Skip to content
Discussion options

You must be logged in to vote

The issue is most likely caused by how App Router handles route segment preservation during intercepted navigation.

When using intercepting routes ((.)) together with parallel routes (@slot), Next.js will only preserve layouts and Server Components if the route segment hierarchy remains unchanged. If a parent segment changes, Next.js may invalidate part of the router cache and remount the affected subtree.

A few things helped resolve similar behavior:

1. Move Data Fetching Higher in the Tree

If analytics or notification data is fetched inside components that belong to a route segment affected by navigation, those components may re-render.

Instead, fetch shared data in a parent layout:

app/d…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by vedalikhitha
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants