You are on page 1of 3

React - Behind the Scenes

React

• When we run the React app ... how is it loaded?

www.luv2code.com © luv2code LLC


Loading React App
File: public/index.html File: src/index.js

<!doctype html> import App from ‘./App‘;


<html lang="en">
... const root = React.DOM.createRoot(
<body>
1 document.getElementById('root')
)
<div id=“root”></div>
<React.StrictMode>
</body> <App/>
</html> </React.StrictMode>
Replaces
2 this id with React

(similar to an “include")
File: src/app.js

return(
<p>We made our first React Application! </p>
)
3

www.luv2code.com © luv2code LLC

You might also like