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
What is the current behavior?
On using useMeasure it is giving the below error with React18 (with server side rendering) 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.
This is happening because of using setState for "refs"
@karanpvyas I solved the issue! I am going to make a PR soon. This is my first contribution to GitHub so I am very new to this. But I will try my best.
What is the current behavior?
On using
useMeasure
it is giving the below error with React18 (with server side rendering)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.
This is happening because of using setState for "refs"
Steps to reproduce it and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have extra dependencies other than
react-use
. Paste the link to your JSFiddle or CodeSandbox example below:https://codesandbox.io/s/poc-hydration-error-skz31g?file=/pages/index.js
What is the expected behavior?
There should be no Suspense Hydration Error
A little about versions:
react-use
: 17.4.0The text was updated successfully, but these errors were encountered: