• Post author:
  • Post category:React JS
  • Post comments:22 Comments
  • Post last modified:April 25, 2020

Visual studio code is a free code editor that is developed by Microsoft, for Windows, Linux and macOS also. I think it is the best editor for the React project. We will discuss step by step how you create a Reactjs application with the use of Visual Studio Code editor.

visual studio code reactjs
Visual Studio Code is The Best Editor for React Application

Why Visual Studio Code Editor for Reactjs Project?

Visual studio code developer and maintained by Microsoft. The editor is very user friendly and in this editor different types of elements like keyword, functions, datatype etc perfectly identify and separate with color code. so you can easily read your code and identify errors at the time of writing code.

The following are the most useful key features that help you to write the React js coding.

Basic editing feature

All types of keyboard shortcuts are working but you can modify your favorite shortcut key as you need. 

some useful editing features separate from other editors. The features are following.

  1. Multi-selection
  2. Multi cursor modification
  3. Shrink and expand selection
  4. Column selection 
  5. Auto Save
  6. Format documents
  7. Format Section 

Find more details about basic editing features 

Useful Extension Available in Marketplace

As react need JSX for so you need to install an essential extension like HTML to JSX which is very important for React.js and many other to increase your productivity. 

IntelliSense

IntelliSense feature in visual studio code is great for coding. It’s work on.JS file also so it helps fast coding.

Note: If you want to build your react project in visual studio code editor then you need nee to install node.js to handle node module and use of node package manager.

How to install Reactjs in Visual Studio Code 

Now we will install and configure visual studio code editor for React.js project step by step.

Download and configure

Step 1: Install Node.Js – Download Node.js  and just run the setup.

Before download Node.js make sure that you have selected the right one which is support by your Operation System.

Step 2: Install Visual Studio Code – Download visual studio code from its official site and run the setup file.

Create and setup app

Step 3: Create a react app in Visual Studio Code – now open the editor and add a folder which is react.js project location, from your computer. 

To open a folder just click on “File–> Open Folder”

visual studio code reactjs
Visual studio code editor open folder

Step 4: Then to execute node command you need to open Visual Studio Code’s Terminal.


To open new terminal just click on “Terminal –> New Terminal”

Open New Terminal
Visual studio code open new terminal

Step 5: Not time to init note module, for init npm (node package manager) just execute the following command in the visual studio code terminal.

npm init

after executing this command all environments for the React.js project automatically initialize and ready for start React.js project.

Step 6: Now time to create react application. Though we can install react, react-DOM and other necessary node models separately. 

See how install it separately  How to start your react project

But we will install it with a single command, just type following command in terminal and press enter.

npx create-react-app my-app 

make sure before before run the command your folder location is correct.

Visual studio code open run npx command
Visual studio code open run npx command

After finishing the app creation process you need to enter your app directory, in this case the directory is “my-app”.

so type “cd my-app” and press enter. 


To run react.js application now you need to type in the command terminal “npm start”. Once the application started the you will see the application in your browser using the URL http://localhost:3000.

3000 is the default port for react.js application

Now you are ready to start development

React Native Webview Example

Create React Native App

Click on above link to know how create react native app

Benefit of Reactjs Application 

Reactjs is an advanced JavaScript library. The application which is developed by Facebook is very fast because it communicates with the server with the use of the JSON file.

So no need to refresh full-page and other resources like CSS, JS, Image and files. React only refresh the particular data which is needed to update, of web page 

No need to develop separately for android and ios.


For React Native and wen application no need to develop different applications for Android and iOS with the same project you can build for Android application and iOS application.

Easy to Maintain big project.


React is a component-based development technique so very easier to develop and maintain complex UI for your application.


React component is reusable, once you build a component you can use it in any other pages.

Sample Hello World Program in Visual Studio Code Reactjs  

Now you can modify your project as you need.

If you want to create a “Simple Hello World” program just you need to modify the “App.js” file under the “src” folder, replace it with the following code.

import React from ‘react’;
import ‘./App.css’;

function App() {
  return (

    <h1>Hello World</h1>

  );
}
export default App;

Hello World

One important thing after update save your program you need to run the following command to refresh the output page.

npm run build


Note: In Visual Studio Code editor automatically execute the command and refreshes the page’s output each time when you save files.

How Work React application

When you run the React.js app first time react process “index.js” file. In “Index.js” file ReactDOM render “App” component. Hare we modify the “App.js” file and return a “<H1>” element with the “Hello World” string value. 


So the App component now return “<h1>Hello World <h1/>”. 

Now let’s see the “index.js” udder “src” folder file where ReactDOM renders the App component’s output into the “root” element.

ReactDOM.render(<App />, document.getElementById(‘root’)); 


Now open “index.html” under “public” folder, you will see a <div> element. Id of this element is “root”

<div id=”root”></div>

The output of App component render init this element.


This is the basic fundamental of the React.js application. You can create your own component and render it into your web pages.


Technically React accepts JSX script and renders it into HTML script then changes the page element with the help of React Virtual DOM. 

FAQ

1. Who will start react project ?

Ans. For the react project you need knowledge about HTML, JavaScript and CSS. and some basic knowledge about programming like function, loop, array, etc.

2. Is React only for mobile app and web application?

Ans. No. React is good for application. but you can also create a website with React.

3. Can I handle server site database or logic by React.js ?

Ans. No React is only for UI Design. But you can call API from and handle server site activities. For server site programming you can use any programming language like C#, PHP, Java, etc.

4. Is React perfect for programmer or UI Developer?

Ans. If you are an UI Developer then React is perfect for you. 

Create React Native App

Create React Native App in Visual Studio Code

Click above link to know more about Visual Studio Code and available extension.

This Post Has 22 Comments

  1. porn

    Another issue is really that video gaming became one of the all-time most significant forms of recreation for people of any age. Kids have fun with video games, and adults do, too. The actual XBox 360 is one of the favorite games systems for folks who love to have hundreds of video games available to them, plus who like to play live with people all over the world. Thanks for sharing your opinions.

  2. pro dentim

    I do love the way you have presented this particular matter plus it really does offer me personally some fodder for consideration. However, from just what I have seen, I only trust when the actual responses pack on that men and women keep on issue and not start on a soap box of the news of the day. Yet, thank you for this superb point and whilst I do not necessarily agree with the idea in totality, I regard the point of view.

  3. golden judi online

    Pretty component of content. I just stumbled upon your site and in accession capital to say that I get actually enjoyed account your blog posts. Anyway I?ll be subscribing for your augment and even I success you access constantly rapidly.

  4. Ikaria juice

    Wow, marvelous blog layout! How long have you been blogging for? you made running a blog glance easy. The total look of your site is magnificent, let alone the content!

  5. Rateio De Concursos

    I have read some good stuff here. Certainly worth bookmarking for revisiting. I wonder how much effort you put to create such a magnificent informative website.

  6. gralion torile

    I have been examinating out a few of your posts and i can claim pretty nice stuff. I will surely bookmark your website.

  7. Office-Fitouts-Sydney.Com.Au

    Nice blog! Is your theme custom made or did you
    download it from somewhere? A theme like yours with
    a few simple tweeks would really make my blog stand out.
    Please let me know where you got your theme. Many thanks

  8. Office Fitout Sydney

    Hi it’s me, I am also visiting this web site on a regular basis,
    this site is truly good and the visitors
    are actually sharing good thoughts.

  9. zoritoler imol

    After all, what a great site and informative posts, I will upload inbound link – bookmark this web site? Regards, Reader.

  10. zoritoler imol

    What i don’t realize is in reality how you’re no longer really a lot more well-preferred than you may be right now. You’re so intelligent. You know therefore considerably in terms of this topic, made me individually consider it from so many varied angles. Its like men and women don’t seem to be fascinated except it?¦s something to do with Woman gaga! Your individual stuffs great. Always maintain it up!

  11. zortilo nrel

    Nice post. I be taught one thing tougher on completely different blogs everyday. It’s going to at all times be stimulating to learn content from different writers and observe a little bit something from their store. I’d favor to make use of some with the content on my blog whether or not you don’t mind. Natually I’ll offer you a hyperlink in your internet blog. Thanks for sharing.

  12. cheap india flights

    Ahaa, its pleasant discussion concerning this paragraph here at this web site, I have
    read all that, so at this time me also commenting here.

  13. cooking oil disposal Dallas

    Excellent post! We will be linking to this great content on our website.
    Keep up the great writing.

  14. Adelaide hypnotherapist

    I am sure this post has touched all the internet viewers, its really really good paragraph
    on building up new weblog.

  15. best veterinarian near me Fort Worth

    If some one desires expert view concerning blogging
    and site-building after that i suggest him/her to go to see this weblog, Keep
    up the fastidious job.

  16. Technology News

    If some one needs to be updated with hottest technologies after that he must
    be visit this web page and be up to date all the time.

  17. มาชัวร์เบท

    Hi there to all, how is all, I think every one is getting more from this website, and your views are nice for new viewers.

  18. hypnotherapist Adelaide

    Hey there this is kind of of off topic but I was wanting to know if blogs use WYSIWYG
    editors or if you have to manually code with HTML. I’m starting a blog soon but have no coding know-how so I wanted to get advice from someone with experience.
    Any help would be greatly appreciated!

  19. zortilo nrel

    Pretty! This was a really wonderful post. Thank you for your provided information.

  20. zovre lioptor

    This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

  21. zortilo nrel

    Hello my friend! I wish to say that this post is awesome, nice written and come with almost all significant infos. I would like to peer extra posts like this .

  22. ford ecosport key replacement cost

    Very nice post. I simply stumbled upon your weblog and wished to mention that I’ve truly enjoyed surfing around your blog posts.

Leave a Reply