Skip to content

react/require-render-return Nursery

What it does

Enforce ES5 or ES6 class for returning value in render function

Why is this bad?

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.

Example

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

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

References

Released under the MIT License.