With Cache Components, the HTML elements from the previous page remain in the DOM. #85709
-
|
After navigating to a new page, the HTML elements from the previous page stay in the DOM in an invisible state. Is this the intended behavior? Reproduction steps: <div>Current Page</div>
<div style="display: none !important;">Prev Page</div> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
That's the Activity component from React, https://react.dev/reference/react/Activity, being wrapped around your routes. It is part of the Cache Components feature set. https://nextjs.org/docs/app/getting-started/cache-components#navigation-with-cache-components There's a max number of routes that'll stay in the DOM before being clean up as well. |
Beta Was this translation helpful? Give feedback.
That's the Activity component from React, https://react.dev/reference/react/Activity, being wrapped around your routes. It is part of the Cache Components feature set. https://nextjs.org/docs/app/getting-started/cache-components#navigation-with-cache-components
There's a max number of routes that'll stay in the DOM before being clean up as well.