Using Render() in ReactJS – Code Example

Total
0
Shares

Render() in reactjs is used to attach components and JSX to the DOM. This helps in generating the UI for the website.

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

root.render(<HelloMessage name="Taylor" />);

Source: Reactjs Docs