Skip to content
← Back to rules

react/no-render-return-value Correctness

What it does ​

This rule will warn you if you try to use the ReactDOM.render() return value.

Why is this bad? ​

Using the return value from ReactDOM.render() is a legacy feature and should not be used.

Note that ReactDOM.renderhas been removed entirely in React 19 and so should generally not be used.

Examples ​

Examples of incorrect code for this rule:

jsx
var inst = ReactDOM.render(<App />, document.body);
function render() {
  return ReactDOM.render(<App />, document.body);
}

Examples of correct code for this rule:

jsx
ReactDOM.render(<App />, document.body);

How to use ​

To enable this rule using the config file or in the CLI, you can use:

json
{
  "plugins": ["react"],
  "rules": {
    "react/no-render-return-value": "error"
  }
}
ts
import { defineConfig } from "oxlint";

export default defineConfig({
  plugins: ["react"],
  rules: {
    "react/no-render-return-value": "error",
  },
});
bash
oxlint --deny react/no-render-return-value --react-plugin

Version ​

This rule was added in v0.0.15.

References ​