NOTE: I’m on a PC. If you’re on another operating system there might be slight differences so do a google search.
Right so you’ve decided you want to build a React app or perhaps you want to convert your html website to React. Great, but how do you do even get started?
PART A
Well first things first, you need node.js installed. Before you go ahead and install anything, just do a quick check to see if it’s installed already.
Open Command prompt and type
npm -v
If you have it installed then it will give you your version number. Otherwise you’ll need to install it. To do that then, go here to find the latest version for your OP.
I have PC so I downloaded the Windows Installer (.msi) file. Run it. You’ll be presented with a setup wizard, so just go through that.
PART B
Now you call install React. In Command Prompt type
npm install -g create-react-app
Now navigate to where you want to install your React App, for example C:\Users\user\Documents\React and type this command
npx create-react-app new-app
Now you need to go into that directory
cd new-app
and fire it up
npm start
Your command prompt will do some funky stuff and present you with this
And will open your browser with this
And what you’ll see in your new-app folder is this
So now you have your React app set up, you can start playing around with code. What I needed to do though, was to translate my plain old html website into a React app. How did I do that then? Lots of trial and error. But I’ll give you an insight into that next.