DEV Community

Cover image for How to Create a React.JS Application
Rithik Samanthula
Rithik Samanthula

Posted on

How to Create a React.JS Application

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:

Alt Text

1. Checking whether Node.JS is up-to-date

First, open your terminal and type node --version:

Alt Text

Check if it Matches with the Node.JS website:

Alt Text

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

Alt Text

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
Enter fullscreen mode Exit fullscreen mode

This will take a few minutes, so grab a cup of tea or coffee :)

Alt Text

If it is successful, you should get an image like this. If not, comment down in this blog post.

Alt Text

Then, cd into the directory by using:

$ cd my-app
Enter fullscreen mode Exit fullscreen mode

Now, open it in VSCode by using

$ code .
Enter fullscreen mode Exit fullscreen mode

It should look something like this:

Alt Text

Then, use the command

$ npm start
Enter fullscreen mode Exit fullscreen mode

You should get something like this:

Alt Text

Finally, Open localhost:3000 in your browser and VOILA, it opens:

Alt Text

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...

Keep Coding Y'All πŸ‘¨πŸ»β€πŸ’»

Top comments (4)

Collapse
 
matjones profile image
Mat Jones

Lol, β€œinstall VS Code” shouldn’t be a step in creating a react app

Collapse
 
therickedge profile image
Rithik Samanthula

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.

Collapse
 
programmeraadi profile image
hmmmmmmcoder

right

Collapse
 
programmeraadi profile image
hmmmmmmcoder

Install vscode is not needed bro