You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the example here, the test uses React.findDomNode(), however, according to React docs React.findDomNode() is deprecated and usage of refs are recommended at its place. Here's what it says -
findDOMNode is an escape hatch used to access the underlying DOM node. In most cases, use of this escape hatch is discouraged because it pierces the component abstraction. It has been deprecated in StrictMode.
Steps to reproduce the behavior: Write a test using the example and see that eslint gives you a warning with most of the presets (I am using airbnb-base though)
Expected behavior
The example should not use findDomNode, or if it's required then a comment explaining it and providing a way to disable the warning should be there (eslint-disable)
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🐛 Bug Report
In the example here, the test uses
React.findDomNode()
, however, according to React docsReact.findDomNode()
is deprecated and usage of refs are recommended at its place. Here's what it says -Additionally, ESLint has a rule against it's usage, due to this discussion started by Dan Abramov. So we should probably update the example to remove its usage?
To Reproduce
Steps to reproduce the behavior: Write a test using the example and see that eslint gives you a warning with most of the presets (I am using
airbnb-base
though)Expected behavior
The example should not use findDomNode, or if it's required then a comment explaining it and providing a way to disable the warning should be there (
eslint-disable
)envinfo
The text was updated successfully, but these errors were encountered: