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.
class ClassName extends React.Component {
render() {
return (
// JSX here...
);
}
}
class Example extends React.Component {
render() {
return (
<h1>Hello World</h1>
);
}
}