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

ReactDOM findDOMNode is deprecated #314

Closed
wereHamster opened this issue Jul 24, 2020 · 2 comments
Closed

ReactDOM findDOMNode is deprecated #314

wereHamster opened this issue Jul 24, 2020 · 2 comments

Comments

@wereHamster
Copy link

https://reactjs.org/docs/react-dom.html#finddomnode

The findDOMNode() function call (and dependency on react-dom) has been added in 34774f9.

AFAIU the code, findDOMNode() shouldn't be needed, you can compare the current ref with the active element directly, since the type of ref.current extends Element:

  if (ref.current === null || document.activeElement === ref.current) {
@JohannesKlauss
Copy link
Owner

Good catch, should be just fine. I'll release a fix in a few minutes.

@JohannesKlauss
Copy link
Owner

Fixed in 2.2.1

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

No branches or pull requests

2 participants