Skip to content
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

Remove react-sizeme to silence findDOMNode deprecation warnings #3959

Merged
merged 2 commits into from
Oct 30, 2024

Conversation

marlo-longley
Copy link
Member

@marlo-longley marlo-longley commented Oct 29, 2024

Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-find-node

This was caused by the react-sizeme library. See ctrlplusb/react-sizeme#231

It seemed fairly straightforward to replace the library with our own HOC since the ResizeObserver is browser native. Since it uses hooks I had to convert the CompanionWindow component to functional. The diff on CompanionWindow looks big mostly because of re-indenting, but I really did not change any of the internal code (as in, I don't think this PR made any of changes that codeclimate hates).

@marlo-longley marlo-longley marked this pull request as ready for review October 29, 2024 21:31
@marlo-longley marlo-longley changed the title Remove Remove react-sizeme to silence findDOMNode deprecation warnings Oct 29, 2024
@jcoyne jcoyne merged commit b848acc into master Oct 30, 2024
6 of 7 checks passed
@jcoyne jcoyne deleted the no-sizme branch October 30, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants