So let's get into it:
Step One
First of all, you need to get Node installed on your machine. If you are not 100% if you have it take a look at the command line.
node -v
If this command gives you an error. Then odds are you need to install node. Head here to get node. Always better to get the latest version. Side note if you wanted to control what version your node is I also have nvm (Node Version Manager) installed. This helps if you are in my situation where work needs one version and my project needs another, I won't get into it here but the read me has all the information you need.
Step Two
Next is to run the react command:
npx create-react-app <app name>
It will then go off and download all the correct packages etc to start up your local react project.
Step Three
cd into your project (the name you just created in the command above) and run the command below:
npm start
This will start your new React app locally on port: 3000. It will automatically open your browser with the screen below.
The code that controls your main javascript file is called App.js.
Here is just a quick example of changing the code.
Hopefully, this at least gets you started and gives you some confidence that your new app is up and running. Remember to save your changes and remember Ctrl + Z is your friend.
Scott
0 Comments