We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
Facebook will eventually deprecate findDOMNode as it blocks certain improvements in React in the future.
findDOMNode
It is recommended to use callback refs instead. See Dan Abramov comments and examples.
Examples of incorrect code for this rule:
class MyComponent extends Component { componentDidMount() { findDOMNode(this).scrollIntoView(); } render() { return <div /> } }
Examples of correct code for this rule:
class MyComponent extends Component { componentDidMount() { this.node.scrollIntoView(); } render() { return <div ref={node => this.node = node} /> } }
The text was updated successfully, but these errors were encountered:
standard/eslint-config-standard-jsx@aca4a0b
This is unfortunate, if you're using a third party library that does not expose the ref you are after you are left with no choice.
ref
jsx-eslint/eslint-plugin-react#678 (comment) explains this perfectly.
And the response is that you should disable it per line with a comment, which is not possible with standard.
jsx-eslint/eslint-plugin-react#678 (comment)
This leaves me being blocked because I'm using standard. If a third party library doesn't provide an adequate API I have to remove my linter?
Sorry, something went wrong.
No branches or pull requests
https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-find-dom-node.md
Facebook will eventually deprecate
findDOMNode
as it blocks certain improvements in React in the future.It is recommended to use callback refs instead. See Dan Abramov comments and examples.
Rule Details
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The text was updated successfully, but these errors were encountered: