I am using create-react-app command to create an empty app, I got these file in src folder:
App.css
App.js
App.test.js
index.css
index.js
logo.svg
serviceWorker.js
setupTests.js
After I make a build via npm run build, index.html is generated in build folder.
I created one manually in src folder, but the build doesn't take it.
The index.js content is:
ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
);
There is no root element at all.
I need to add in some <script> tag inside index.html to include some third party scripts (which cannot be installed by nodejs), where can I add them since it is not existed in src folder?
You have to check public folder in the root directory only. You will get your index.html would be there. and your index.js file which is in src folder is the single point of connection between them(main index.html in public folder and all Javascript code which is in src folder).

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With