React's goal is in many ways to render HTML in a web page. React renders HTML to the web page by using a function called createRoot() and its method render()$. The createRoot Function The createRoot() function takes one argument, an HTML element. The purpose of the function is to define the HTML element where a React component should be displayed. The render Method The render() method is then called to define the React component that should be rendered. Example: Display a paragraph inside an element The Root Node The HTML element provided to createRoot() acts as a container for your app. It is usually a <div> element with the id root, and it exists inside the index.html file: