ScanSkill

render()

The render() method is the method that renders the JSX elements in the DOM. It is the required method in the class component of React.

Syntax

class ClassName extends React.Component {
  render() {
    return (
      // JSX here...
    );
  }
}

Example

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