react/no-find-dom-node
eslint-plugin-react
No autofixRecommended
eslint.config.js
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-find-dom-node": "error",
},
},
];class MyComponent extends Component {
componentDidMount() {
findDOMNode(this).scrollIntoView();
}
render() {
return <div />
}
}class MyComponent extends Component {
componentDidMount() {
this.node.scrollIntoView();
}
render() {
return <div ref={node => this.node = node} />
}
}Examples from the ESLint documentation.
react/no-find-dom-node
eslint-plugin-react
import react from "eslint-plugin-react";
export default [
{
plugins: { react },
rules: {
"react/no-find-dom-node": "error",
},
},
];react/no-find-dom-node
react plugin · correctness
{
"plugins": [
"react"
],
"rules": {
"react/no-find-dom-node": "error"
}
}Biome does not have this rule.
Disallow direct mutation of this.state
Disallow unescaped HTML entities from appearing in markup
Disallow variables used in JSX to be incorrectly marked as unused
Enforce ES5 or ES6 class for returning value in render function