Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze React node while transitioning in Next.js #902

Open
ckull opened this issue May 8, 2024 · 0 comments
Open

Freeze React node while transitioning in Next.js #902

ckull opened this issue May 8, 2024 · 0 comments

Comments

@ckull
Copy link

ckull commented May 8, 2024

I'm working on routing transition where previous node and current node are intersecting between with the set timeout around 2000ms. Everything seems perfect except that when routing all state in previous node has reset to initial state such as the scrollY has reset to 0 and all states and useEffect has been call once again. This cause me a lot of problems for example If I try to navigate from the Menu Drawer, all exiting node states get reset to initial state and menu drawer is disappear instantly. Are there any way to freeze and stop re-rendering the previous node while transitioning? I have found this react-freeze but have no idea how to freeze directly to the exiting node while transitioning.

onExit={(node) => { //freeze node and stop rerender }

localhost-3000-google-chrome-2024-05-08-18-36-57-000002205-000007131_LDpjOlpu.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant