ReactDOM.render

This is basically the
entry point
for a React application into the browser’s DOM. It has 2 arguments:
The first argument is WHAT to render to the browser. This is always a “React element”.
The second argument is WHERE to render that React element in the browser. This has to be a valid DOM node that exists in the statically rendered HTML. The example above uses a special
mountNode2
element which exists in the playground’s display area (the first
mountNode
is used for the native version).
What exactly is a React element? It’s a VIRTUAL element describing a DOM element. It’s what the
React.createElement
API method returns.

Check more information on
.

React.createElement

Instead of working with strings to represent DOM elements (as in the native DOM example above) in React we represent DOM elements with
objects
using calls to the
React.createElement
method. These objects are known as React elements.
The
React.createElement
function has many arguments:
The first argument is the HTML “tag” for the DOM element to represent, which is
div
in this example.
The second argument is for any attributes (like
id
,
href
,
title
, etc.) we want the DOM element to have. The simple
div
we’re using has no attributes, so we used
null
in there.
The third argument is the content of the DOM element. We’ve put a “Hello React” string in there. The optional third argument and all the optional arguments after it form the
children
list for the rendered element. An element can have 0 or more children.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.