SlideShare a Scribd company logo
ReactJs : Tutorial-01-Introduction
React / React.js / ReactJS
 JavaScript Library
 Fast & Interactive UI Building
 In 2011 by FaceBook - Software Engineer, Jordan Walke
 Sizable and Complex UIs with Small – Isolated code
 Sometimes React called Framework but technically it’s a
Library.
 React Native is a framework (like Vue.js and Angular)
 React.JS version V16.13.1 (July 2020). (reactjs.org)
 Create-react-app version 2.0 supports Babel 7, webpack 4, and
Jest23.
Thinking in React Component
 React Component is a bunch of independent, isolated and reusable
bunch of code.
 Like a simple function, it can call, pass some input and they render
some output.
 Reuse components, Merge them, Complex UI.
Setting up a React Environment
Step: 1 : Install node.js (nodejs.org)
Step: 2 : check version of nodejs and npm
Step: 3 : Install ReactJs
$ npm install –g create-react-app
Step: 4 : Create first application
$ create-react-app myapp (must be small letters)
Step: 5 : It will create myapp folder, change folder using ‘cd’
ReactJs : Tutorial-01-Introduction
$ cd myapp
Step: 6: To run the project
User/Jainul/myapp$ npm start
Manual Setup of a React Environment
Step: 1 : Install node.js (nodejs.org)
Step: 2 : check version of nodejs and npm
Step: 3 : Create a project folder i.e. myapp and go to the folder myapp
Step: 4 : Create package.json
$ npm init.
Step: 5 : Now we will install the packages that we need.
Open the terminal or command prompt and run the commands inside the folder myapp/.
npm install react --save-dev
npm install react-dom --save-dev
npm install react-scripts --save-dev
Step: 6 : Create a folder src/ where all the js code will come in that folder.
All the code for reactjs project will be available in the src/ folder.
Create a file index.js and add import react and react-dom, as shown below.
Index.js
import React from 'react';
import ReactDOM from 'react-dom';
ReactDOM.render(
<h1>Hello, from RTDL Tutorials!</h1>,
document.getElementById('root')
);
Step: 7 : Create a folder public/ and add index.html in that as shown below
<!DOCTYPE html>
<html>
ReactJs : Tutorial-01-Introduction
<head>
<meta charset="UTF-8" />
<title>ReactJS Demo</title>
</head>
<body>
<div id = "root"></div>
</body>
</html>
We will have the directory structure as shown below…
reatproj/
src/
index.js
node_modules/
public/
index.html
package.json
Step: 8 : We have added the commands to compile the final file in
package.json as follows:
"scripts": {
"start": "react-scripts start"
},
Step: 9 : To compile the final file run following command:
npm start
Step: 10 : The URL http://localhost:3000 will open in the browser once the code is
compiled as shown below:

More Related Content

PDF
React js t6 -lifecycle
PDF
React js t8 - inlinecss
PDF
React js t4 - components
PDF
React js t7 - forms-events
PDF
React js t5 - state
PDF
React js t3 - es6
PDF
React js use contexts and useContext hook
PDF
Introduction to React Hooks
React js t6 -lifecycle
React js t8 - inlinecss
React js t4 - components
React js t7 - forms-events
React js t5 - state
React js t3 - es6
React js use contexts and useContext hook
Introduction to React Hooks

What's hot (20)

PDF
React custom renderers
PDF
React: JSX and Top Level API
PDF
React native app with type script tutorial
PDF
Redux and context api with react native app introduction, use cases, implemen...
PDF
[Fevr] Can't live if livin' is without rendering
PPTX
React hooks
PDF
3 Simple Steps to follow to Create React JS Components
ODP
Introduction to Angular 2
PDF
Get rid of controllers in angular 1.5.x start using component directives
PPTX
Pluginkla2019 - React Presentation
PPTX
PPTX
ReactJs
PPTX
Migrating an application from Angular 1 to Angular 2
PPTX
Concurrent Rendering Adventures in React 18
PPTX
7 Redux challenges
PPTX
Code migration from Angular 1.x to Angular 2.0
PPTX
Running SQL from a Groovy Event Handler in Agile PLM
PDF
Asp dot-net core problems and fixes
PDF
Angular 2... so can I use it now??
PPTX
Angular 2
React custom renderers
React: JSX and Top Level API
React native app with type script tutorial
Redux and context api with react native app introduction, use cases, implemen...
[Fevr] Can't live if livin' is without rendering
React hooks
3 Simple Steps to follow to Create React JS Components
Introduction to Angular 2
Get rid of controllers in angular 1.5.x start using component directives
Pluginkla2019 - React Presentation
ReactJs
Migrating an application from Angular 1 to Angular 2
Concurrent Rendering Adventures in React 18
7 Redux challenges
Code migration from Angular 1.x to Angular 2.0
Running SQL from a Groovy Event Handler in Agile PLM
Asp dot-net core problems and fixes
Angular 2... so can I use it now??
Angular 2
Ad

Similar to React js t1 - introduction (20)

PPTX
PPTX
slides.pptx
PPTX
slides.pptx
PDF
How To Integrate Native Android App With React Native.
PPTX
ReactJS software installation
PPTX
How to install ReactJS software
PPTX
How create react app help in creating a new react applications
PDF
Building framework with shared code on Android and iOS using React Native. UA...
PPTX
1. react - native: setup
PPTX
React Basic and Advance || React Basic
PPTX
Lecture 1 Introduction to React Native.pptx
PDF
React - Inroduction and Fundamentals.pdf
PPTX
React_Complete.pptx
PPT
Maven: Managing Software Projects for Repeatable Results
PPTX
Native development kit (ndk) introduction
PPTX
React JS Lecture 10.pptx Our clg lecture
PPTX
Building an Ionic hybrid mobile app with TypeScript
PPTX
React Django Presentation
PDF
learning react
slides.pptx
slides.pptx
How To Integrate Native Android App With React Native.
ReactJS software installation
How to install ReactJS software
How create react app help in creating a new react applications
Building framework with shared code on Android and iOS using React Native. UA...
1. react - native: setup
React Basic and Advance || React Basic
Lecture 1 Introduction to React Native.pptx
React - Inroduction and Fundamentals.pdf
React_Complete.pptx
Maven: Managing Software Projects for Repeatable Results
Native development kit (ndk) introduction
React JS Lecture 10.pptx Our clg lecture
Building an Ionic hybrid mobile app with TypeScript
React Django Presentation
learning react
Ad

More from Jainul Musani (20)

PDF
Core Java Interface Concepts for BCA Studetns
PDF
Java Abstract and Final Class for BCA students
PDF
Java Collection Framework for BCA Students
PDF
Simple Calculator using JavaFx a part of Advance Java
PDF
JavaFx Introduction, Basic JavaFx Architecture
PDF
ASP.NET 2010, WebServices Full Example for BCA Students
PDF
Palindrome Programme in PHP for BCA students
PDF
Leap Year Program in PHP for BCA students
PDF
"PHP and MySQL CRUD Operations for Student Management System"
PDF
Python: The Versatile Programming Language - Introduction
PPTX
Python a Versatile Programming Language - Introduction
PDF
React js t2 - jsx
PPTX
ExpressJs Session01
PPTX
NodeJs Session03
PPTX
NodeJs Session02
PPTX
Nodejs Session01
PDF
Java exercise1
PPSX
Fundamentals of JDBC
PPT
Core Java Special
PDF
Core Java Special
Core Java Interface Concepts for BCA Studetns
Java Abstract and Final Class for BCA students
Java Collection Framework for BCA Students
Simple Calculator using JavaFx a part of Advance Java
JavaFx Introduction, Basic JavaFx Architecture
ASP.NET 2010, WebServices Full Example for BCA Students
Palindrome Programme in PHP for BCA students
Leap Year Program in PHP for BCA students
"PHP and MySQL CRUD Operations for Student Management System"
Python: The Versatile Programming Language - Introduction
Python a Versatile Programming Language - Introduction
React js t2 - jsx
ExpressJs Session01
NodeJs Session03
NodeJs Session02
Nodejs Session01
Java exercise1
Fundamentals of JDBC
Core Java Special
Core Java Special

Recently uploaded (20)

PPTX
master seminar digital applications in india
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Complications of Minimal Access Surgery at WLH
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Basic Mud Logging Guide for educational purpose
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
Pre independence Education in Inndia.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Business Ethics Teaching Materials for college
PPTX
Pharma ospi slides which help in ospi learning
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
master seminar digital applications in india
Module 4: Burden of Disease Tutorial Slides S2 2025
Complications of Minimal Access Surgery at WLH
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Basic Mud Logging Guide for educational purpose
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
TR - Agricultural Crops Production NC III.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Week 4 Term 3 Study Techniques revisited.pptx
Pre independence Education in Inndia.pdf
RMMM.pdf make it easy to upload and study
Microbial diseases, their pathogenesis and prophylaxis
Renaissance Architecture: A Journey from Faith to Humanism
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Business Ethics Teaching Materials for college
Pharma ospi slides which help in ospi learning
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
FourierSeries-QuestionsWithAnswers(Part-A).pdf
O7-L3 Supply Chain Operations - ICLT Program
O5-L3 Freight Transport Ops (International) V1.pdf

React js t1 - introduction

  • 1. ReactJs : Tutorial-01-Introduction React / React.js / ReactJS  JavaScript Library  Fast & Interactive UI Building  In 2011 by FaceBook - Software Engineer, Jordan Walke  Sizable and Complex UIs with Small – Isolated code  Sometimes React called Framework but technically it’s a Library.  React Native is a framework (like Vue.js and Angular)  React.JS version V16.13.1 (July 2020). (reactjs.org)  Create-react-app version 2.0 supports Babel 7, webpack 4, and Jest23. Thinking in React Component  React Component is a bunch of independent, isolated and reusable bunch of code.  Like a simple function, it can call, pass some input and they render some output.  Reuse components, Merge them, Complex UI. Setting up a React Environment Step: 1 : Install node.js (nodejs.org) Step: 2 : check version of nodejs and npm Step: 3 : Install ReactJs $ npm install –g create-react-app Step: 4 : Create first application $ create-react-app myapp (must be small letters) Step: 5 : It will create myapp folder, change folder using ‘cd’
  • 2. ReactJs : Tutorial-01-Introduction $ cd myapp Step: 6: To run the project User/Jainul/myapp$ npm start Manual Setup of a React Environment Step: 1 : Install node.js (nodejs.org) Step: 2 : check version of nodejs and npm Step: 3 : Create a project folder i.e. myapp and go to the folder myapp Step: 4 : Create package.json $ npm init. Step: 5 : Now we will install the packages that we need. Open the terminal or command prompt and run the commands inside the folder myapp/. npm install react --save-dev npm install react-dom --save-dev npm install react-scripts --save-dev Step: 6 : Create a folder src/ where all the js code will come in that folder. All the code for reactjs project will be available in the src/ folder. Create a file index.js and add import react and react-dom, as shown below. Index.js import React from 'react'; import ReactDOM from 'react-dom'; ReactDOM.render( <h1>Hello, from RTDL Tutorials!</h1>, document.getElementById('root') ); Step: 7 : Create a folder public/ and add index.html in that as shown below <!DOCTYPE html> <html>
  • 3. ReactJs : Tutorial-01-Introduction <head> <meta charset="UTF-8" /> <title>ReactJS Demo</title> </head> <body> <div id = "root"></div> </body> </html> We will have the directory structure as shown below… reatproj/ src/ index.js node_modules/ public/ index.html package.json Step: 8 : We have added the commands to compile the final file in package.json as follows: "scripts": { "start": "react-scripts start" }, Step: 9 : To compile the final file run following command: npm start Step: 10 : The URL http://localhost:3000 will open in the browser once the code is compiled as shown below: