-
Notifications
You must be signed in to change notification settings - Fork 28.5k
react-resize-detector broken in dev env since v14.0.2 #58767
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.
8000By 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
Comments
react.js doesn't seem to like running react-resize-detector inside StrictMode. turn this off and you should be able to see the width and height output. Just created a PR on your repro that gives you an overview of what you need to do to get RRD to work again. |
Sorry @JesseKoldewijn, but I don't think disabling |
See what you can do is disabling strictmode globally and opting in by the use of React.StrictMode everywhere except for the element that uses RRD. One of the errors I've gotten was that it has to do with deprecated client-side api usage within react-resize-detector. Besides, this is not an issue on Next.js but upstream in either React.js or RRD. (RRD should be the party to fix this matter since they're using unsupported code in their package. This library basically throws due to usage of code that might work fine in client-only applications but wont when using any form of server-rendering. |
there is already an issue maslianok/react-resize-detector#247 (comment) and I commented on my findings |
This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you. |
Uh oh!
There was an error while loading. Please reload this page.
Link to the code that reproduces this issue
https://github.com/Ungedummt/debug-nextjs
To Reproduce
Current vs. Expected behavior
Currently
Only the red div is visible because the size of the green div is set to undefined.
Expected
Both the red and green divs should appear. This is because the size of the green div is intended to be constrained to match the size of the red div, provided by the functionality of
react-resize-detector
.Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
App Router
Additional context
I've also tried to export this as a static page, which seems to work. Also it works on hot reload.
The problem exists since this commit: 1b5e307
The text was updated successfully, but these errors were encountered: