react/require-render-return

February 9, 2026 ยท View on GitHub

๐Ÿ“ Enforce ES5 or ES6 class for returning value in render function.

๐Ÿ’ผ This rule is enabled in the โ˜‘๏ธ recommended config.

When writing the render method in a component it is easy to forget to return the JSX content. This rule will warn if the return statement is missing.

Rule Details

Examples of incorrect code for this rule:

var Hello = createReactClass({
  render() {
    <div>Hello</div>;
  }
});

class Hello extends React.Component {
  render() {
    <div>Hello</div>;
  }
}

Examples of correct code for this rule:

var Hello = createReactClass({
  render() {
    return <div>Hello</div>;
  }
});

class Hello extends React.Component {
  render() {
    return <div>Hello</div>;
  }
}