SlideShare a Scribd company logo
By Sahana Banerjee
REACT JS
WHAT IS REACT.JS?
A JavaScript library for building user interfaces. Reactjs is
created by the Facebook for the V of MVC by reusable and
interactive UI components.
WHO IS USING REACTJS?
 Facebook – Partial
 Instagram
 Netflix
 Paypal…etc
WHY REACT.JS?
 V(view) of MVC - Solution of View in MVC
 Virtual DOM - Reactjs use the concept of virtual DOM which helps in the performance
 Unidirectional Data Flow - Compare to the 2 way data binding. Reactjs use the concept of
Unidirectional data flow which improve the over all performance.
 UI Components - Reusable and interactive components
 SEO Friendly - Components are client side as well as server side render hence they are SEO
friendly and no 3rd party plugin required
 Coding is simpler because of JSX
 Reactjs own debugger
 React Native is going to be next big thing
 Big minds are backing Reactjs
CORE CONCEPT OF REACTJS
Unidirectional
Data Flow
ComponentsJSX
Virtual DOM
JSX
JSX - javascript XML syntax transform.
It helps in making our writing code easier and
faster. JSX lets us writeHTML (not 100%) with XML
based object representation.
Line 8-19 : Telling browser the code between the script block is JSX and not normal
JavaScript.
Line no 12 : This is how we write the HTML in JSX
COMPONENTS
 In Reactjs the whole application is break into the
components.
 Components are interactive, reusable and
stateful too.
If you don’t want to use JSX, you can still work in react however the code would be like
the above as compare to the last slide without JSX
Line 9 : We are creating our component with name MyApp
Line 18 : We are calling/rendering our component in the content div on the HTML
page
LETS START
For a simple React program:
 Download react
 Download JSX
 Install React debugger tool (Chrome)
For building React Apps :
 Gulp
 Browserify
 Node js, etc …
SIMPLE REACT PROGRAM
COMPONENTS
 Everything in reactjs is components.
 The core building blocks of React application is
components only.
 Components interact with each other and maintain the
state too.
 In Reactjs whole application is need to be break into
the component only.
PROPS
 In Reactjs props are like the HTML Properties. They are
used to pass the data between the components or via
the states.
 In Reactjs the props can be accessed by
this.props.propsname
 Props can be define by name=“value”. To access this we
have to call this.props.name
React.render(<MyComponent name=“Neha” />) : name is the one of the props of
the component MyComponent . To access the value of the props in the react we
use {this.props.name}.
STATES
• Every component has a State object. Can be set by using
setState.
• setState triggers UI updates and to get the initial state
before the setState :
• getInitialState
• getDefaultProps
Reactjs maintained the state – getIntialState, setState, getDefaultProps.
In the above example we are getting the count variable to 5 and accessing it by
{this.state.count}
COMPONENT LIFECYCLE
 componentWillMount – Client and server side
componenet Will Occur only once (before)
 componentDidMount – Only once (after)
 shouldComponentUpdate – Return value
determines weather component should update
 componentWillUnmount – Before unmounting
component
EVENTS
 Reactjs has the events that are attached
with the components as the props of the
components and can trigger methods.
We have created a custom method clickCount and onClick of the button we are
calling it onClick = {this.clickCount}
UNIDRIECTIONAL DATA FLOW
 In reactjs, application data flows unidirectional via the
state and props not like angular js where we have 2-way
data binding. Which means in multiple component
hierarchy , a common parent component should manage
the state and pass it down the chain by props.
 setState - state should be updated by setState to ensure
UI will refresh/update
 this.props – to pass the value to the child components
UNIDIRECTIONAL DATA FLOW
- In Reactjs application the data flow from the parent to the children
component by the state and the props.
- Only one parent is responsible to update the states and passing the
value to the children components via props.
- setState is used to update/refresh the UI when the state change and
the value can be pass to the children component by the this.props
VIRTUAL VIRTUAL DOM
 Reactjs uses the concept of the virtual DOM.
 It selectively render the subtree of DOM elements into the
rendering of the DOM on state change
 Use different algorithm with the browser DOM tree to identify
the changes
 Instead of creating new object, Reactjs just identify what change
is took place and once identify update that state.
 This way it is creating a virtual DOM and improving the
performance too
 Can be render on server and sync on Local
Angular Backbone React
Type MV* MVC V
Technology HTML/CSS/JS/Ang
ular
HTML/CSS/JS/back
bone
JSX
Core MVC MVC Components
View HTML HTML Virtual DOM
Data Flowing 2 way binding - Unidirectional
Creator Google - FB* & Instagram
Architchure - - React Native &
Flux
SEO Support Phantom js - SEO friendly
THANK YOU!
28
Thankyou 

More Related Content

What's hot

Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
namespaceit
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
 
ReactJS
ReactJSReactJS
React and redux
React and reduxReact and redux
React and redux
Mystic Coders, LLC
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
Intro to React
Intro to ReactIntro to React
Intro to React
Justin Reock
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
Bojan Golubović
 
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
Ritesh Mehrotra
 
React js
React jsReact js
React js
Alireza Akbari
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Hoang Long
 
Learn react-js
Learn react-jsLearn react-js
Reactjs
Reactjs Reactjs
Reactjs
Neha Sharma
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
Imran Sayed
 
React JS part 1
React JS part 1React JS part 1
React JS part 1
Diluka Wittahachchige
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
Bethmi Gunasekara
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
Rob Quick
 
Intro to React
Intro to ReactIntro to React
Intro to React
Eric Westfall
 

What's hot (20)

Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
ReactJS
ReactJSReactJS
ReactJS
 
React and redux
React and reduxReact and redux
React and redux
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
React workshop
React workshopReact workshop
React workshop
 
React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
React js
React jsReact js
React js
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Reactjs
Reactjs Reactjs
Reactjs
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
React JS part 1
React JS part 1React JS part 1
React JS part 1
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Intro to React
Intro to ReactIntro to React
Intro to React
 

Similar to ReactJs

Getting started with react &amp; redux
Getting started with react &amp; reduxGetting started with react &amp; redux
Getting started with react &amp; redux
Girish Talekar
 
SharePoint Framework y React
SharePoint Framework y ReactSharePoint Framework y React
SharePoint Framework y React
SUGES (SharePoint Users Group España)
 
Copy of React_JS_Notes.pdf
Copy of React_JS_Notes.pdfCopy of React_JS_Notes.pdf
Copy of React_JS_Notes.pdf
suryanarayana272799
 
React JS Interview Question & Answer
React JS Interview Question & AnswerReact JS Interview Question & Answer
React JS Interview Question & Answer
Mildain Solutions
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR3
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Remo Jansen
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
StephieJohn
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
Atlogys Technical Consulting
 
React
ReactReact
React
ReactReact
Everything to Know About React Re-Rendering: A Comprehensive Guide
Everything to Know About React Re-Rendering: A Comprehensive GuideEverything to Know About React Re-Rendering: A Comprehensive Guide
Everything to Know About React Re-Rendering: A Comprehensive Guide
BOSC Tech Labs
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
SHAIKIRFAN715544
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
dhanushkacnd
 
React Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHatReact Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHat
Scholarhat
 
Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"
Flipkart
 
Learn Stateful and Stateless components in ReactJS
Learn Stateful and Stateless components in ReactJS Learn Stateful and Stateless components in ReactJS
Learn Stateful and Stateless components in ReactJS
RajasreePothula3
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
Chiew Carol
 

Similar to ReactJs (20)

Getting started with react &amp; redux
Getting started with react &amp; reduxGetting started with react &amp; redux
Getting started with react &amp; redux
 
SharePoint Framework y React
SharePoint Framework y ReactSharePoint Framework y React
SharePoint Framework y React
 
Copy of React_JS_Notes.pdf
Copy of React_JS_Notes.pdfCopy of React_JS_Notes.pdf
Copy of React_JS_Notes.pdf
 
React JS Interview Question & Answer
React JS Interview Question & AnswerReact JS Interview Question & Answer
React JS Interview Question & Answer
 
Intro react js
Intro react jsIntro react js
Intro react js
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...React JS; all concepts. Contains React Features, JSX, functional & Class comp...
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Tech Talk on ReactJS
Tech Talk on ReactJSTech Talk on ReactJS
Tech Talk on ReactJS
 
React
ReactReact
React
 
React
ReactReact
React
 
Everything to Know About React Re-Rendering: A Comprehensive Guide
Everything to Know About React Re-Rendering: A Comprehensive GuideEverything to Know About React Re-Rendering: A Comprehensive Guide
Everything to Know About React Re-Rendering: A Comprehensive Guide
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 
React Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHatReact Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHat
 
Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"Presentation on "An Introduction to ReactJS"
Presentation on "An Introduction to ReactJS"
 
Learn Stateful and Stateless components in ReactJS
Learn Stateful and Stateless components in ReactJS Learn Stateful and Stateless components in ReactJS
Learn Stateful and Stateless components in ReactJS
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 

Recently uploaded

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 

Recently uploaded (20)

Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 

ReactJs

  • 2. WHAT IS REACT.JS? A JavaScript library for building user interfaces. Reactjs is created by the Facebook for the V of MVC by reusable and interactive UI components.
  • 3. WHO IS USING REACTJS?  Facebook – Partial  Instagram  Netflix  Paypal…etc
  • 4. WHY REACT.JS?  V(view) of MVC - Solution of View in MVC  Virtual DOM - Reactjs use the concept of virtual DOM which helps in the performance  Unidirectional Data Flow - Compare to the 2 way data binding. Reactjs use the concept of Unidirectional data flow which improve the over all performance.  UI Components - Reusable and interactive components  SEO Friendly - Components are client side as well as server side render hence they are SEO friendly and no 3rd party plugin required  Coding is simpler because of JSX  Reactjs own debugger  React Native is going to be next big thing  Big minds are backing Reactjs
  • 5. CORE CONCEPT OF REACTJS Unidirectional Data Flow ComponentsJSX Virtual DOM
  • 6. JSX JSX - javascript XML syntax transform. It helps in making our writing code easier and faster. JSX lets us writeHTML (not 100%) with XML based object representation.
  • 7. Line 8-19 : Telling browser the code between the script block is JSX and not normal JavaScript. Line no 12 : This is how we write the HTML in JSX
  • 8. COMPONENTS  In Reactjs the whole application is break into the components.  Components are interactive, reusable and stateful too.
  • 9. If you don’t want to use JSX, you can still work in react however the code would be like the above as compare to the last slide without JSX
  • 10. Line 9 : We are creating our component with name MyApp Line 18 : We are calling/rendering our component in the content div on the HTML page
  • 11. LETS START For a simple React program:  Download react  Download JSX  Install React debugger tool (Chrome) For building React Apps :  Gulp  Browserify  Node js, etc …
  • 13. COMPONENTS  Everything in reactjs is components.  The core building blocks of React application is components only.  Components interact with each other and maintain the state too.  In Reactjs whole application is need to be break into the component only.
  • 14.
  • 15. PROPS  In Reactjs props are like the HTML Properties. They are used to pass the data between the components or via the states.  In Reactjs the props can be accessed by this.props.propsname  Props can be define by name=“value”. To access this we have to call this.props.name
  • 16. React.render(<MyComponent name=“Neha” />) : name is the one of the props of the component MyComponent . To access the value of the props in the react we use {this.props.name}.
  • 17. STATES • Every component has a State object. Can be set by using setState. • setState triggers UI updates and to get the initial state before the setState : • getInitialState • getDefaultProps
  • 18. Reactjs maintained the state – getIntialState, setState, getDefaultProps. In the above example we are getting the count variable to 5 and accessing it by {this.state.count}
  • 19. COMPONENT LIFECYCLE  componentWillMount – Client and server side componenet Will Occur only once (before)  componentDidMount – Only once (after)  shouldComponentUpdate – Return value determines weather component should update  componentWillUnmount – Before unmounting component
  • 20.
  • 21. EVENTS  Reactjs has the events that are attached with the components as the props of the components and can trigger methods.
  • 22. We have created a custom method clickCount and onClick of the button we are calling it onClick = {this.clickCount}
  • 23. UNIDRIECTIONAL DATA FLOW  In reactjs, application data flows unidirectional via the state and props not like angular js where we have 2-way data binding. Which means in multiple component hierarchy , a common parent component should manage the state and pass it down the chain by props.  setState - state should be updated by setState to ensure UI will refresh/update  this.props – to pass the value to the child components
  • 24. UNIDIRECTIONAL DATA FLOW - In Reactjs application the data flow from the parent to the children component by the state and the props. - Only one parent is responsible to update the states and passing the value to the children components via props. - setState is used to update/refresh the UI when the state change and the value can be pass to the children component by the this.props
  • 25.
  • 26. VIRTUAL VIRTUAL DOM  Reactjs uses the concept of the virtual DOM.  It selectively render the subtree of DOM elements into the rendering of the DOM on state change  Use different algorithm with the browser DOM tree to identify the changes  Instead of creating new object, Reactjs just identify what change is took place and once identify update that state.  This way it is creating a virtual DOM and improving the performance too  Can be render on server and sync on Local
  • 27. Angular Backbone React Type MV* MVC V Technology HTML/CSS/JS/Ang ular HTML/CSS/JS/back bone JSX Core MVC MVC Components View HTML HTML Virtual DOM Data Flowing 2 way binding - Unidirectional Creator Google - FB* & Instagram Architchure - - React Native & Flux SEO Support Phantom js - SEO friendly