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
![image](https://private-user-images.githubusercontent.com/5457857/247065730-5e521dd2-9f6e-40e0-a9c6-a2106ac0807f.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYxMjYzOTIsIm5iZiI6MTcyNjEyNjA5MiwicGF0aCI6Ii81NDU3ODU3LzI0NzA2NTczMC01ZTUyMWRkMi05ZjZlLTQwZTAtYTljNi1hMjEwNmFjMDgwN2YucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDkxMiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA5MTJUMDcyODEyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9Nzg4NjhiY2Q5YjgwZmIyYmU5ZjcwMDgwYjE0NjNmMTRmOWUyZjI3YmYyZTVkOTQ3OWRhYjliYTI0MDQ5ZTE1MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.BZltmxcw22EYq_1hvmziL2DRGdblViB2EBVfw3Zn8Pg)
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: