React - elements

0 votes
175 views
added Jul 17, 2019 in React by LC Marshal Captain (25,790 points)

React applications built in a single HTML element. It called root node (root element).

//root node
<div id="root"></div>

//react element
const element = <h1>Hi React!</h1>

//Elements are rendered/displayed with the ReactDOM.render() method:
ReactDOM.render(element, document.getElementById('root'));

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...