What the heck is React DOM?

In the previous story i talked about component instantiation. We know that the App component’s instantiation has been in our application from the start, in the src/index.js file:

Next to React which is imported from react, there is another imported library called react-dom, in which a ReactDOM.render() function uses an HTML node to replace it with JSX.

Essentially that’s everything needed to integrate React into any application which uses HTML.

In more detail, ReactDOM.render() expects two arguments; the first is to render the JSX.

It creates an instance of your App component, though it can also pass simple JSX without any component instantiation:

The second argument specifies where the React application enters your HTML. It expects an element with an id=’root’, found in the public/index.html file. This is a basic HTML file.


What the heck is React DOM? was originally published in Javarevisited on Medium, where people are continuing the conversation by highlighting and responding to this story.

This post first appeared on Read More