# react/no-render-return-value

> Disallow using the return value of `ReactDOM.render`

`ReactDOM.render` returns the root component's instance, but only if React has rendered it by the time the call returns. React doesn't promise that. To get the instance, give the root element a `ref` callback. React calls it when the instance exists.

The rule reports the call when its result is stored in a variable or a property, assigned, or returned.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. To turn it on:

```toml bunfig.toml
[lint.rules]
"react/no-render-return-value" = "error" # or "warn"
```

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}
```jsx
const app = ReactDOM.render(<App />, document.body);
```

{/* bad */}
```jsx
function mount(root) {
  return ReactDOM.render(<App />, root);
}
```

Not reported:

{/* good */}
```jsx
let app;

ReactDOM.render(<App ref={instance => (app = instance)} />, document.body);
```
