Change into the directory of the location of the node project
cd nodeProjects
Create a react app project with
npx create-react-app dojo-blog
dojo-blog
is the name of the react app being created
Change into the directory of the project
cd nodeProjects
open the dojo-blog
in code
code dojo-blog
The node_modules
directorys contains everything for node, is a large file,
and often not included in git repos, if so, install it
npm install
The scripts to run the react index file are in the package.json
file in scripts :
You can run the following scripts command in the console
npm run start
npm run build
Use the following script command to open index.html
in a browswer
npm run start
Make a change to App.js
files,
App.js
is injected into index.js
which grabs the div id="root"
element and injects
itself with the function App()
from App.js
Delete uneccesary files we are not using
App.text.js
and
reportWebVitals.js
make sure to remove the import from index.js
If you delete anything, make sure you delete it from any scripts, like
the logo.png
The index.js
script gets injected into the div id='root'
element.
The App()
function gets put in the index.js
by doing the following
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);