---
title: "react/require-render-return"
description: "Require the `render` method of a class component to return something"
# Generated by src/codegen/lint-rule-docs.ts. Do not edit below this line.
plugin: "react"
aliases: []
kind: null
category: "nursery"
default: "off"
fixable: "no"
typeAware: false
deprecated: false
---

A `render` method without `return` gives React `undefined`. React 18 and later show nothing for it, and older versions throw. The usual cause is JSX written as a statement with the `return` forgotten.

{/* 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/require-render-return" = "error" # or "warn"
```

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

## Examples

Reported:

{/* bad */}
```jsx
class Greeting extends React.Component {
  render() {
    <h1>Hello {this.props.name}</h1>;
  }
}
```

Not reported:

{/* good */}
```jsx
class Greeting extends React.Component {
  render() {
    return <h1>Hello {this.props.name}</h1>;
  }
}

class Footer extends React.Component {
  render = () => <footer>{this.props.text}</footer>;
}
```
