Build ECommerce site using React js ?
So with this build i will learning and sharing and building the complete react js app for e-commerce.
- First delete the Src folder
- Create a new folder src
- Create a new file index.js
Step 3 :
index.js will call the parent component and render it in div with id root which is there in index.html inside the public folder
import React from 'react'
import reactDom from 'react-dom'
import App from './App.js'
reactDom.render(<App />, document.getElementById('root'))
here we can see the App component which is the parent component is rendered in the div which is root
content of the index.html inside the public folder.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>Ecommerce</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>