Whenever we create a React project and run it with the help of npm start command, it looks like the below image.
Now, we will try to understand how a React application is loaded and started. For this, try to understand these 3 steps:
Step 1
It renders the “index.html” page. In this page, inside the body tag, there is a “div” having id “root”, like this:
- <body>
- <noscript>
- You need to enable JavaScript to run this app.
- </noscript>
- <div id="root"></div>
- </body>
This is the place (div) where a React application gets loaded.
Step 2
Now, this id (root) can be seen in the file “index.js” file inside the render method, like this:
- ReactDOM.render(<App />, document.getElementById('root'));
The render method takes two arguments, first is <App/> component and the second is the place where it renders the code of App component; i.e element (root).
- Import App from ‘./App’;
Step 3
Let’s go to “App.js” file. This is the file where we see our first and only React component present by default in our application. Now, we can remove all the existing lines and put “React App by Mahesh Verma” inside the <p> tag, like,
- class App extends Component {
- render() {
- return (
- <div className="App">
- <header className="App-header">
- <img src={logo} className="App-logo" alt="logo" />
- <h1 className="App-title">Welcome to React</h1>
- </header>
- <p className="App-intro">
- React application by Mahesh Verma.
- </p>
- </div>
- );
- }
- }
We save it and run our application with the help of npm start
We can also change component name from “App” to any other name, but we have to be sure that we also change the same name in App.js file and export the same name.
Conclusion
From the above article, let us just quickly revise how React application gets loaded.

Sri RamPosted Jul 27, 2022, 9:49 PM
Useful info. Could you please explain on how to handle the navigation from a .net web app to a React app?
Hadshana KamalanathanPosted Sep 7, 2018, 12:04 PM
Thanks for sharing....
Bhairab DuttPosted Aug 29, 2018, 3:12 AM
Nice Article for React Learning ....
Manoranjan TiwariPosted Aug 29, 2018, 1:37 AM
Well explained in a simple language.