-
Notifications
You must be signed in to change notification settings - Fork 860
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
NavigationMenu not working with hydration (React 18, Suspense) #2350
Comments
After troubleshooting for 4 hours, i found where the issue lies. It's these lines: If you uncomment: onIndicatorTrackChange={setIndicatorTrack} on line 349 & 358 in https://github.com/radix-ui/primitives/blob/main/packages/react/navigation-menu/src/NavigationMenu.tsx I would prefer a complete fix, as uncommenting these lines introduce a little minor problem with focusing if you have fields that gets focused it can make the menu close etc.. Can anyone use this to fix it in the radix ui package so everyone can use this with hydration? |
This same thing is happening with me with Tooltip Trigger |
Any updates on this? |
Can someone provide a reproduction sandbox? |
Also happening with the dropdown menu trigger. The issue is the generated |
Hey there, Here is the commit, that leads to the hydration issue: I hope this helps :) |
here is my issue: |
If you add a Suspense Await block inside a NavigationMenu Item, you will get the following error:
Code:
Error:
react-dom.development.js:20702 Uncaught Error: This Suspense boundary received an update before it finished hydrating. This caused the boundary to switch to client rendering. The usual way to fix this is to wrap the original update in startTransition.
at updateDehydratedSuspenseComponent (react-dom.development.js:20702:48)
at updateSuspenseComponent (react-dom.development.js:20362:16)
at beginWork (react-dom.development.js:21624:14)
at beginWork$1 (react-dom.development.js:27426:14)
at performUnitOfWork (react-dom.development.js:26560:12)
at workLoopSync (react-dom.development.js:26466:5)
at renderRootSync (react-dom.development.js:26434:7)
at performSyncWorkOnRoot (react-dom.development.js:26085:20)
at flushSyncCallbacks (react-dom.development.js:12042:22)
at commitRootImpl (react-dom.development.js:26959:3)
The text was updated successfully, but these errors were encountered: