Learn Before
Concept
Rendering in React
React needs to create a root element to render components. React will compare previous elements with the changed elements to render only the required parts.
An element is immutable, like a frame of a movie, representing the current view at a given time.
// create root element in element with **root** id const root = ReactDOM.createRoot( document.getElementById('root') ); // define an element const element = <h1>Hello, world!</h1> // render element when is required root.render(element);
0
1
Updated 2023-01-26
Tags
JavaScript Programming Language
Related
Rendering in React
State in React Js
Lifecycle Methods in React Class Components
Handling Events in React
React References
React Frameworks
Describing the UI in React
What is true about ReactJS?
Which of the following is true about about React Bootstrap?
Which of the following are true regarding the difference between React events and DOM events?