Closed wscotten closed 9 months ago
From the error message you provided, I assume findDOMNode
is not available in Edge runtime?
The app still compiles and works fine for me, so seems like it's no more than a console warning atm, and not a blocking error.
https://react.dev/reference/react-dom/findDOMNode
Sadly, findDOMNode
is a legacy that we cannot simply throw away. 🫤
We use the findDOMNode
function to power withResizeDetector
and ResizeDetector
components "automatically", without the need for the user to pass the ref
prop.
And since we can't achieve the same behavior without findDOMNode
, it leaves us with a choice of either deprecating withResizeDetector
and ResizeDetector
, or rewriting them to require passing a ref
. Both of which are a breaking change and would require a major version bump.
I think that's something that only @maslianok can approve and implement.
Also, please read this section of the README 👇 https://github.com/maslianok/react-resize-detector#refs
Thank you for getting back to me!
I am currently using refs. So there is no end-user bug, just a lot of console noise.
findDOMNode is deprecated though, so I hope the maintainers migrate off it at some point!
We've streamlined our library by eliminating all methods except hooks. I think today, no one uses Class Components and HOCs, so it's ok to support "useResizeDetector" only.
This version is currently in beta and can be installed via npm install react-resize-detector@10.0.0-beta.0.
We anticipate releasing it as a stable version in the coming weeks.
Hello! Love using your package. I am trying to migrate my Next.js app to use Edge functions but run into this error when using react-resize-detector:
Package with minimal repro: https://github.com/wscotten/recharts-bug
When you comment out the following lines in app/page.tsx the error goes away.