Plugin: react-featuresRules
no-find-dom-node
Prevent using findDOMNode. This rule is part of eslint-plugin-react-features and provides LLM-optimized error messages.
Prevent using findDOMNode. This rule is part of eslint-plugin-react-features and provides LLM-optimized error messages.
Quick Summary
| Aspect | Details |
|---|---|
| Severity | Error (deprecated API) |
| Auto-Fix | ❌ No auto-fix |
| Category | React |
| ESLint MCP | ✅ Optimized for ESLint MCP integration |
| Best For | All React/JSX projects |
Rule Details
findDOMNode is deprecated and will be removed in future React versions. Use refs instead.
Examples
❌ Incorrect
import { findDOMNode } from 'react-dom';
class MyComponent extends React.Component {
componentDidMount() {
const node = findDOMNode(this);
node.focus();
}
}✅ Correct
import React, { useRef, useEffect } from 'react';
function MyComponent() {
const ref = useRef(null);
useEffect(() => {
ref.current?.focus();
}, []);
return <div ref={ref}>Content</div>;
}Related Rules
no-string-refs- Prevent string refs
Use this rule
npm install -D oxlint-plugin-react-features{ "jsPlugins": ["oxlint-plugin-react-features"], "rules": { "react-features/no-find-dom-node": "error" }}import { defineConfig } from 'vite-plus';export default defineConfig({ lint: { jsPlugins: ['oxlint-plugin-react-features'], rules: { 'react-features/no-find-dom-node': 'error', }, },});oxlint-plugin-react-features re-exports eslint-plugin-react-features/oxlint: the same rules under the same IDs, and no ESLint install. Why oxlint.
Did this rule catch something? Star the repo to get new CWE coverage as we ship it — or follow the AI-code-security benchmarks behind these rules.