focus-trap / focus-trap-react

A React component that traps focus
http://focus-trap.github.io/focus-trap-react/demo/
MIT License
713 stars 64 forks source link

R19 support #1343

Closed timfishercs closed 1 month ago

timfishercs commented 1 month ago

Description

R19 doesn't support findDOMNode, is there any plans to remove references to it?

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 at FocusTrap (/.node_modules/focus-trap-react/dist/focus-trap-react.js:47:5)

Versions

Sandbox Minimal reproduction in something like CodeSandbox:

Screen Capture Recording or screenshot of what you're seeing -- if the repro isn't sufficient to explain it.

stefcameron commented 1 month ago

@timfishercs Thanks for asking. This library's use of findDOMNode was long-since been removed (back in 2022), see #710 🎉

I've been casually working on R19 support and, having reviewed all the upcoming changes, the only thing that really needs to be done is strip-out the propTypes and remove the dependency on the prop-types package since that will just be ignored now by R19.

The one thing I will do, however, as part of "supporting" R19 is cut a new major where I'll set the minimum supported version of React to 18.3.x Right now, the minimum is ancient, back to R16, and that's too much to support going forward given R18 has been around for nearly 2 years already.

So for all intents and purposes, focus-trap-react should already be ready for R19 -- unless you're seeing something I'm not?

timfishercs commented 1 month ago

@stefcameron My apologies, there were sub packages using the older version. All the tests pass so I presume everything is ok, will verify. Nice work keeping it up to date!

stefcameron commented 1 month ago

Cool! Thanks for adding your resolution and closing the issue. 😀