New
Introducing React Doctor for Enterprise

react-doctor/no-find-dom-node

Use refs (useRef/createRef) to access DOM nodes instead of the removed findDOMNode API.

Validation prompt

Use this to decide whether a fired diagnostic is real or a false positive.

Fires on any call expression whose callee is a bare findDOMNode(...) identifier or a member call <NS>.findDOMNode(...) where <NS> is exactly React, ReactDOM, or ReactDom — findDOMNode was deprecated in 2018 and removed entirely in React 19. Calls through any other object (SomeModule.findDOMNode(this)) do not fire, and merely referencing it without calling (this.fn = React.findDOMNode) is also ignored. False positive: a locally defined helper coincidentally named findDOMNode that has nothing to do with React still trips the bare-identifier check, since the rule keys only on the callee name.

Fix prompt

Use this once validation confirms the diagnostic is real.

Attach a ref to the element you need and read the node from it instead of locating it after render: const ref = useRef(null) (or createRef() in a class), pass ref={ref} to the JSX, then use ref.current. If you only needed it to scroll or measure, call ref.current.scrollIntoView() / getBoundingClientRect() directly — there is no replacement for findDOMNode in React 19, so the call must be removed. See https://oxc.rs/docs/guide/usage/linter/rules/react/no-find-dom-node

More Correctness rules from the rules reference:

  • react-doctor/no-jsx-element-type: Widen the return type from JSX.Element to React.ReactNode: function App(): React.ReactNode
  • react-doctor/no-legacy-class-lifecycles: Move side effects in `componentWillMount` to `componentDidMount`; replace `componentWillReceiveProps` with `componentDidUpdate` (compare prevProps) or the static `getDerivedStateFromProps` for pure state derivation; replace `componentWillUpdate` with `getSnapshotBeforeUpdate` paired with `componentDidUpdate`. The `UNSAFE_` prefix only silences the warning — React 19 removes both forms.
  • react-doctor/no-legacy-context-api: Replace `childContextTypes` + `getChildContext` with `const MyContext = createContext(...)` + `<MyContext.Provider value={...}>`; replace `contextTypes` with `static contextType = MyContext` (single context) or `useContext()` / `use()` from a function component. The provider and every consumer must migrate together — partial migrations leave consumers reading the wrong context.
  • react-doctor/no-namespace: Drop the namespace and use a plain (Pascal-cased) component or DOM tag.
  • react-doctor/no-nested-component-definition: Move to a separate file or to module scope above the parent component