Want to set up a local development environment for React.JS? Then this is the blog for you.
This blog is for MAC and WINDOWS users.
Here are the steps:
1. Checking whether Node.JS is up-to-date
First, open your terminal and type node --version
:
Check if it Matches with the Node.JS website:
2. Install Visual Studio Code
For this tutorial, I will be downloading Visual Studio Code because it is much easier to develop React Applications. If you would like to use another text editor, feel free to do so.
Head over to Visual Studio Code's website and choose the operating system that you use
Then, wait for some time for the ZIP file to download.
After the ZIP file is completed downloading, double click on it.
It will take a couple of seconds to do so.
After that, Drag VSCode to your Applications Folder.
3. Using create-react-app
Open a terminal and type the following:
$ npx create-react-app my-app
This will take a few minutes, so grab a cup of tea or coffee :)
If it is successful, you should get an image like this. If not, comment down in this blog post.
Then, cd
into the directory by using:
$ cd my-app
Now, open it in VSCode by using
$ code .
It should look something like this:
Then, use the command
$ npm start
You should get something like this:
Finally, Open localhost:3000
in your browser and VOILA, it opens:
As the page says, if you want to write your own react code, edit the src/App.js
file.
Thanks for reading the blog.
And remember...
Top comments (4)
Lol, “install VS Code” shouldn’t be a step in creating a react app
In the blog post, I also wrote: "If you would like to use another text editor, feel free to do so." I used VSCode for the sake of this tutorial. I recommended VSCode because it is very good for developing react apps.
right
Install vscode is not needed bro