You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When navigating to a page that contains a route param, Next will remount the entire layout. If there are any animations present this will trigger them on every page navigation instead of on initial site load.
There are suggetions to use a query or to handle the route programatically. They appear to be working but the Link component should provide this functionality as well.
This discussion was converted from issue #12297 on April 29, 2020 09:02.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When navigating to a page that contains a route param, Next will remount the entire layout. If there are any animations present this will trigger them on every page navigation instead of on initial site load.
To Reproduce
My
_app.js
`class CustomApp extends App {
render() {
const { Component, pageProps } = this.props;
}`
Link that will trigger a remount
<Link href="/product/handle"><a>{props.link_text}</a></Link>
Link that will not trigger a remount
<Link href="/product"><a>{props.link_text}</a></Link>
Expected behavior
The shared layout should not remount on navigation with route params.
System information
Additional context
It appears #4653 is a similar issue.
There are suggetions to use a query or to handle the route programatically. They appear to be working but the Link component should provide this functionality as well.
Beta Was this translation helpful? Give feedback.
All reactions