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:
deslop/commonjs-in-esm: Flag CommonJS constructs (require/module.exports/exports.x) inside an ESM module.deslop/lazy-import-at-top-level: Flag a dynamic import() at module top level that is awaited or .then/.catch/.finally-ed during load (no laziness benefit); prefer a static import.deslop/simplifiable-expression: Disallow expressions that collapse to a simpler equivalent, e.g. !!x → Boolean(x).deslop/simplifiable-function: Disallow functions written less directly than needed: block-arrow-single-return, redundant-await-return, useless-async-no-await.deslop/ts-escape-hatch: Disallow TypeScript suppressions that hide type errors.