Return to previous page How to keep page status #73493
Unanswered
MhandsomeM
asked this question in
App Router
Replies: 1 comment
-
In simple terms, it is to maintain the state of the old page and should not lose the state when returning. |
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
-
Current behavior:
In the home page, there is a counter and a uniqueId,
Click add, the counter will increase
Click about at the top, go to the about page and return, the counter has been reset, and the uniqueId is still the same.
(home- > about- > home) Click about at the top, and click home. At this time, the data of the first home and the second home are the same.
Expected behavior:
When returning to the previous page, the original page data should be retained (using zustand, the context should be achievable, But I don't think it should require any treatment.,Maybe I overlooked some configuration?), but how to distinguish the data of the first home and the second home, so that the two pages have their own state
How to solve the problem of returning to the previous page The client side component is re-executed, so that the state distinction between the two home pages can be solved
(Above is machine translation)
QQ2024123-114623.mp4
Beta Was this translation helpful? Give feedback.
All reactions