Introduction to React.js

Started by Terry Igho · 0 Replies
Posted: 8 w
React, sometimes referred to as a frontend JavaScript framework, is a JavaScript library created by Facebook.

React is a tool for building UI components.

How does React Work?
React creates a VIRTUAL DOM in memory.

Instead of manipulating the browser's DOM directly, React creates a virtual DOM in memory, where it does all the necessary manipulating, before making the changes in the browser DOM.

React only changes what needs to be changed!

React finds out what changes have been made, and changes only what needs to be changed.


<!DOCTYPE html>
<script src="" crossorigin></script>
<script src="" crossorigin></script>
<script src=""></script>

<div id="mydiv"></div>

<script type="text/babel">
function Hello() {
return <h1>Hello World!</h1>;

const container = document.getElementById('mydiv');
const root = ReactDOM.createRoot(container);
root.render(<Hello />)

Share on my timeline