React

22 lessons

Achievements
Combined Shape@2x

The Certificate

avatar

render() Function

The render() method represents the defined HTML code inside a specified HTML element. The syntax of the function is as follows:

The method takes on two arguments, HTML code, and element.

The rendering will take place in a folder located inside the root directory, for preface we’ll name it “public”. In the said folder, you can find an index.html file.

The file body takes on a single <div>, and the rendering will take place there.

Find an example displaying the above-written text below:

The id of the element is “root”, as that is the standard protocol, but it doesn’t have to be.

As mentioned, the result can be found in <div id="root">.

More about Root

root is an HTML element where developers can find the result. For the informal definition- it acts as a container for managing content.

It can be named anything, for example, ‘wild’.