react/no-render-return-value
Disallow using the return value of ReactDOM.render — a legacy escape hatch removed in React 19.
- Category: Correctness
- Severity: warn
- Source:
oxlint-builtin:react - Framework: global
- Enabled when: always (unless customRulesOnly=true)
- Documentation: https://oxc.rs/docs/guide/usage/linter/rules/react/no-render-return-value.html
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires when the return value of ReactDOM.render() is captured — assigned to a variable, returned from a function, or used in any expression. The instance return was a legacy escape hatch; React 18 deprecated it and React 19 removed ReactDOM.render entirely. A bare ReactDOM.render(<App />, container) call with no assignment is fine. False positive: an unrelated render() helper not imported from react-dom.
Fix prompt
Use this once validation confirms the diagnostic is real.
Drop the variable assignment — if you needed a handle to the root component, use a regular ref inside <App /> instead. On React 18+, switch to createRoot from react-dom/client: const root = createRoot(container); root.render(<App />); call root.unmount() where you previously needed unmountComponentAtNode. See https://oxc.rs/docs/guide/usage/linter/rules/react/no-render-return-value.html and https://react.dev/reference/react-dom/client/createRoot
Related rules
More Correctness rules from the rules reference:
react/no-string-refs: Disallow legacy string refs like ref='node' — use createRef, useRef, or callback refs.react/no-unknown-property: Disallow unknown or mis-cased DOM attributes in JSX, like class instead of className.react/require-render-return: Require class component render() methods to return a value — a missing return renders nothing.react/rules-of-hooks: Enforce the Rules of Hooks: call hooks only at the top level of components and custom hooks, never in conditions or loops.deslop/commonjs-in-esm: Flag CommonJS constructs (require/module.exports/exports.x) inside an ESM module.