Here, we will learn about how to create a brand new React Application using Visual Studio Code.
Prerequisites:
- Node.js must be installed.
- npx must be installed
- Any code editor like Visual Studio Code
- Basic knowledge of JavaScript, HTML and CSS
Let’s get start with creating a new react application.
To create an application in React first of all you need to install Visual Studio Code Editor. It is helpful to create application in React. You can also use other editors also.
- Open the folder in which you want to create the application. Then open terminal and fire the following command. “sampleapp” is my application name.
npx create-react-app sampleapp
- Go to that new application using the following command
cd sampleapp
- Now, open the App.js file. Change the code in the App function
import './App.css'; function App() { return ( <h1>Hello World!!!!</h1> ); } export default App;
- To run the application again open the terminal and fire the following command
npm start
- The HTML in the app.js will be reflected in web. Now, whatever you change in app.js file it will reflect in web immediately.