SlideShare a Scribd company logo
1 of 26
ReactJS
INTRODUCTION
 React is a popular JavaScript library for building user
interfaces.
 It was developed by Facebook and is widely used in web
development.
 React allows you to create reusable UI components
Applications of ReactJS
 Instagram is completely based on the ReactJS library
 geolocations, Google Maps APIs, search engine
 Netflix
 Yahoo Mail
 Whatsapp uses ReactJS for building user interfaces
ReactJS installation in ubuntu
If We've previously installed create-react-app globally via
npm install -g create-react-app
We can can create react project as :
create-react-app my-app
cd my-app
npm start
In Lab Systems npm install -g create-react-app is already installed in all the systems.
create-react-app my-app needs internet connection to download the packages
(around 100MB).
So myapp project is shared in all the systems React-Node.zip file in Desktop which
needs to be extracted
Installation in Windows
nodejs.org/en
 After installation
 All programs->nodejs folder-> open command prompt
 Type node –v
 It will display the version
 npm install –g create-react-app
 After installing create-react-app create new project
 Create-react app demo-project
 Use npm start to run the program
Video demo of installation (windows)
 https://www.youtube.com/watch?v=0twjvW0c1r0&t=1s
Features of React:
• Components are like functions that return HTML
elements.
• Types
1. Class components
2. Function components
Class Component
A class component must include the extends
React.Component statement.
This statement creates an inheritance to React.Component,
and gives your component access to React. Component's
functions.
It also require render() method, this method returns HTML
Example
class Car extends React.Component {
render()
{
return <h2>Hi, I am a Car!</h2>;
}
}
Function Component
A Function component also returns HTML
Behaves much the same way as a Class component
But Function components can be written using much less code, are
easier to understand
Example
function Car()
{
return <h2>Hi, I am a Car!</h2>;
}
Props
Components can be passed as props, which stands for properties.
Props are like function arguments, and you send them into the
component as attributes.
function Car(props)
{
return <h2>I am a {props.color} Car!</h2>;
}
What is JSX?
JSX allows us to write HTML in
React.
JSX makes it easier to write and
add HTML in React.
Nested Elements in JSX
you need to wrap it with one
container element.
Here, we use div as a container
element which has three nested
elements inside it.
JSX uses camelcase naming
convention for attributes
JSX allows us to use comments
that begin with /* and ends with */
and wrapping them in curly braces
{}
Arrow Functions
Before:
hello = function() {
return "Hello World!";
}
With Arrow Function:
hello = () => {
return "Hello World!";
}
import React, { Component } from
"react";
In this import statement, the code is importing the Component
class from the "react" module or package.
The curly braces {} are used to destructor the named import,
allowing you to selectively import specific elements from a
module.
Components in React can contain the following elements:
1.JSX (JavaScript XML) Markup: JSX allows you to write HTML-like
markup within your JavaScript code,
2.State: State allows a component to keep track of and manage changes
to its data over time.
3.Props (Properties): Components can receive data and configuration
through props
4.Event Handlers:
</button>{" "}
The {" "} following the closing </button> tag is optional and is
used to add a space between the two buttons for visual
separation. It doesn't affect the functionality of the button or the
event handling.
The return statement in the render method of a React
component is used to define and specify the structure and
content of the component's rendered output. It determines what
will be displayed on the screen when the component is
rendered.
JSX Styling
React always recommends to
use inline styles.
To set inline styles, you need to
use camelCase syntax.
Inside the render method, there is a variable declaration var
myStyle which defines a JavaScript object.
This object represents the CSS styles that will be applied to the
<h1> element.

More Related Content

Similar to ReactJS.pptx

react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
janet736113
 

Similar to ReactJS.pptx (20)

Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
React Basic and Advance || React Basic
React Basic and Advance   || React BasicReact Basic and Advance   || React Basic
React Basic and Advance || React Basic
 
Top 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptxTop 10 Techniques For React Performance Optimization in 2022.pptx
Top 10 Techniques For React Performance Optimization in 2022.pptx
 
Unit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptxUnit 2 Fundamentals of React -------.pptx
Unit 2 Fundamentals of React -------.pptx
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
 
Learn react by Etietop Demas
Learn react by Etietop DemasLearn react by Etietop Demas
Learn react by Etietop Demas
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
 
react-en.pdf
react-en.pdfreact-en.pdf
react-en.pdf
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
Interview Questions On React JS.pptx
Interview Questions On React JS.pptxInterview Questions On React JS.pptx
Interview Questions On React JS.pptx
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
React js
React jsReact js
React js
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
3 Simple Steps to follow to Create React JS Components
3 Simple Steps to follow to Create React JS Components3 Simple Steps to follow to Create React JS Components
3 Simple Steps to follow to Create React JS Components
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
React js
React jsReact js
React js
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 

ReactJS.pptx

  • 2. INTRODUCTION  React is a popular JavaScript library for building user interfaces.  It was developed by Facebook and is widely used in web development.  React allows you to create reusable UI components
  • 3. Applications of ReactJS  Instagram is completely based on the ReactJS library  geolocations, Google Maps APIs, search engine  Netflix  Yahoo Mail  Whatsapp uses ReactJS for building user interfaces
  • 4. ReactJS installation in ubuntu If We've previously installed create-react-app globally via npm install -g create-react-app We can can create react project as : create-react-app my-app cd my-app npm start In Lab Systems npm install -g create-react-app is already installed in all the systems. create-react-app my-app needs internet connection to download the packages (around 100MB). So myapp project is shared in all the systems React-Node.zip file in Desktop which needs to be extracted
  • 7.  After installation  All programs->nodejs folder-> open command prompt  Type node –v  It will display the version  npm install –g create-react-app  After installing create-react-app create new project  Create-react app demo-project  Use npm start to run the program
  • 8. Video demo of installation (windows)  https://www.youtube.com/watch?v=0twjvW0c1r0&t=1s
  • 9. Features of React: • Components are like functions that return HTML elements. • Types 1. Class components 2. Function components
  • 10. Class Component A class component must include the extends React.Component statement. This statement creates an inheritance to React.Component, and gives your component access to React. Component's functions. It also require render() method, this method returns HTML
  • 11. Example class Car extends React.Component { render() { return <h2>Hi, I am a Car!</h2>; } }
  • 12. Function Component A Function component also returns HTML Behaves much the same way as a Class component But Function components can be written using much less code, are easier to understand
  • 14. Props Components can be passed as props, which stands for properties. Props are like function arguments, and you send them into the component as attributes. function Car(props) { return <h2>I am a {props.color} Car!</h2>; }
  • 15. What is JSX? JSX allows us to write HTML in React. JSX makes it easier to write and add HTML in React.
  • 16. Nested Elements in JSX you need to wrap it with one container element. Here, we use div as a container element which has three nested elements inside it.
  • 17.
  • 18. JSX uses camelcase naming convention for attributes JSX allows us to use comments that begin with /* and ends with */ and wrapping them in curly braces {}
  • 19. Arrow Functions Before: hello = function() { return "Hello World!"; } With Arrow Function: hello = () => { return "Hello World!"; }
  • 20. import React, { Component } from "react"; In this import statement, the code is importing the Component class from the "react" module or package. The curly braces {} are used to destructor the named import, allowing you to selectively import specific elements from a module.
  • 21. Components in React can contain the following elements: 1.JSX (JavaScript XML) Markup: JSX allows you to write HTML-like markup within your JavaScript code, 2.State: State allows a component to keep track of and manage changes to its data over time. 3.Props (Properties): Components can receive data and configuration through props 4.Event Handlers:
  • 22. </button>{" "} The {" "} following the closing </button> tag is optional and is used to add a space between the two buttons for visual separation. It doesn't affect the functionality of the button or the event handling.
  • 23. The return statement in the render method of a React component is used to define and specify the structure and content of the component's rendered output. It determines what will be displayed on the screen when the component is rendered.
  • 24. JSX Styling React always recommends to use inline styles. To set inline styles, you need to use camelCase syntax.
  • 25.
  • 26. Inside the render method, there is a variable declaration var myStyle which defines a JavaScript object. This object represents the CSS styles that will be applied to the <h1> element.