top of page

React Js



What Is React?


React is a declarative, efficient, and flexible JavaScript library for building user interfaces.


How to Inastall Reactjs

first we have Download and Install Node.js Download and Install Visual Studio Code Editor

after that install js


Step 1: To get started, we need to open a command prompt using Win+R and type 'cmd'. Then, type in the following command

npm install -g create-react-app

When using create-react-app ensure you are in the desired directory/folder location as this command will create the project folder in the current path.


Step 2: To create a new project and deploy React into it, we will run the following command to create myapp.

create-react-app myapp

Run a React Project Application


To run our new project, we need to use the command prompt to change to the project folder, then start it. The cd myapp command will take us to the myapp folder.

cd myapp

The npm start command will run the project application.


What is Babel?


Babel is a JavaScript compiler that can translate markup or programming languages into JavaScript.

React uses Babel to convert JSX into JavaScript.


What is node Module ?

Node modules folder is the repositry of modules/library which you are using inside your project. what ever you are importing in your project that module or library should present inside the node_module folder. when you do npm install that time that module or library inntall inside the node_module folder and one entry addded in package.json file.


What is JSX?

JSX stands for JavaScript XML/HTML like extension to JavaScript.

ReactDOM.render(
    <h1>Hello React!</h1>,
    document.getElementById('root'));

As you can see above, inside the ReactDom.render() look like HTML that is JSX ,JSX is not JavaScript nor HTML.


How to print hello world using reactjs


import React from 'react'; import ReactDOM from 'react-dom'; import './index.css';

ReactDOM.render( < h1 > Hello World < /h1>, document.getElementById('root') );

just wirte above code in index,js


Output

If you have project or assignment files, You can send atcontact@codersarts.com  directly


תגובות


bottom of page