React installation
Welcome to my next blog.
in this blog i'm share with some coding example of react.
in this blog i'm share with some coding example of react.
How to start react project:-
you need to use IDE to start using. you can simply use VS code for coding. and also have some paid development tools like webstom. Some university's provide free license for this IDE.
After that first you need to create project.To start project you need to write like this.
open the cmd in your project folder location
then you need to write
npx create-react-app <app name>
then need to go app folder using cd <app name>
next you can start react project using npm start key word
if you haven't install react-dom need to install it
npm install react-dom --save
then you need to install webpacks using these codes
npm install webpack webpack-dev-server webpack-cli --save
If you working with html files you need to install babel packages
code is:-
npm install babel-core --save-dev
Simple app using react
In app.js
first you need to import React
import React, { Component } from 'react'
//then need to create class extending components
class App extends Component{ render(){ return( <div> <h1>First React App</h1> </div> ); } }
//finally need to export class
export default App;
Output :- "First React App"
It runs in your localhost.
fdgfd
Comments
Post a Comment