I created a react project using
create-react-app react-app
Then a react-app was created with all the folders. (Using Visual Studio Code)
Then deleted the "src" folder using rimraf
Then opened index.html and deleted all its content.
Then ! and enter and created the HTML boilerplate code in index.html
Then created following div in it,
<div id="root">
React Component goes here....
</div>
Now created "src" folder and in it created "index.js" with following content,
import React from "react";
import ReactDOM from "react-dom";
import "../node_modules/bootstrap/dist/css/bootstrap.css";
import HelloComponent from "./components/helloComponent";
import BindingComponent from "./components/bindingComponent";
ReactDOM.render(
<React.Fragment>
<HelloComponent name={"Rohit"} />
<HelloComponent />
<BindingComponent></BindingComponent>
</React.Fragment>,
document.querySelector("#root")
);
In "package.json" i have the following in scripts section,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Also created React Components in the components folder
Now when I run using npm start, how does it call index.js ???