SlideShare a Scribd company logo
1 of 36
Ram Murat Sharma | rammurat.rms.sharma0@gmail.com | @rammrms
 Introduction to React?
 React features
 Installation
 React philosophy
 Coupling vs Cohesion
 JSX
 Flux
 Components
 Why components?
 React component life
cycle
◦ Initial phase
◦ Lifetime phase
◦ Tear Down phase
 Data flow
 Virtual DOM
 States and Props
 Events
 Final HTML
 Angular VS React
 Why React?
 Where is React?
 Questions?
 What is Next?
 What you should know already
◦ Good knowledge of JavaScript and HTML
◦ Basic understanding of HTML DOM
 Technical preparations
◦ Latest Chrome browser on your system
◦ Your preferred IDE
◦ React developer debugger tool (Currently, available
for Chrome)
 A library for building user interfaces
 Designed for View layer
 Created by Facebook/Instagram developers
 Build reusable & Interactive UI components
 Renders your UI and respond to events
 Build Components not templates
 Re-render on every change
 Fast Virtual DOM
 Unidirectional data binding
 Reusable and Interactive components
 Components are loosely coupled and highly
cohesive
 JSX (Easy to write)
 No more explicit DOM operations – everything
is declarative
 Own debugger
 Individual download
◦ <script src="https://fb.me/react-0.14.5.min.js"></script>
◦ <script src="https://fb.me/react-dom-0.14.5.min.js"></script>
 npm
◦ npm install –-save react react-dom
 bower
◦ bower install –-save react react-dom
Coupling
The degree to which each program module relies on
each of the other modules.
Cohesion
The degree to which elements of a module belong
together.
 Writing code made easy and faster
 Nothing but writing HTML in JavaScript
 It’s not mandatory, you are allowed to write
your JavaScript instead
JavaScript XML Syntax Transform
Flux is the application architecture that Facebook uses for
building client-side web applications. It complements React's
composable view components by utilizing a unidirectional data
flow. It's more of a pattern rather than a formal framework
var Hello = React.createClass({
render: function() {
return <div>Hello
{this.props.name}</div>;
}
});
ReactDOM.render(
<Hello name="World" />,
document.getElementById('containe
r')
);
var Hello = React.createClass({
render: function() {
return
React.createElement("div",null,
"Hello ", this.props.name);
}
});
ReactDOM.render(
<Hello name="World" />,
document.getElementById('container')
);
 Components are reusable
 Components are composable
 Components are unit testable
 Every component has “state” and “props”
 Components cab be wrapped using
<div>,<span>,<Counter>,<ActionButton>
Initialization Phase
Lifetime Phase
Tear Down Phase
getDefaultProps()
getInitialState()
componentWillMount()
render()
componentDidMount()
componentWillReceiveProps()
shouldComponentUpdate()
componentWillUpdate()
render()
componentDidUpdate()
This is the phase
when an element lives
and changes its states
and properties.
componentWillUnmount()
 React follows unidirectional data flow like
other MVC framework
 Data flow happen from parent to child in
components by their state and props
 Only immediate parent is allowed to pass the
data to it’s children components
 React has Virtual DOM and event system
 React builds a new virtual DOM subtree on every
update
 React always compares its virtual DOM on change
not actual DOM
 Instead of creating new object, react just identify
what changes are took place and update the
referenced object and DOM accordingly
 Optimized for performance and memory
footprint
 All updates happen trough a batch process
States
 Every component has default state object.
 State can be set by using this.setState() method.
Probs
 In React props are like the HTML properties.
 They are used to pass data between components.
 name={value} is used to set the property in
component.
 this.props.propertyname is used to read values
which are passed from its parent.
var Hello = React.createClass({
getInitialState: function() {
return { author: “”};
},
handleAuthorChange: function(e) {
this.setState({author: e.target.value});
},render: function() {
return (
<div>
<p>Hello {this.props.bookName}</p>
<form>
<input value={this.state.author}
onChange={this.handleAuthorChange}/>
</form>
</div>;
}
});
ReactDOM.render(
<Hello bookName=“Notebook" />,
document.getElementById('container')
);
 React has its own
events.
 These events are
attached to its
components.
 These events can
trigger methods as
per need.
Events
Final HTML
Feature Angular React
Layers MVC V
Technology - JSX
Core Structure MVC Components
Data Flow 2 way Unidirectional
Owner Google Facebook/Instagram
Architecture - Flux
SEO support Phantom JS SEO friendly
 Can be used partially for your application
 Fast DOM manipulation
 Components allows you to separate your entities
 Easy to build, grasp and well thought out
 SEO friendly – Components can be rendered client
side and server side
 JSX let you write HTML in JavaScript
 JSX
https://jsfiddle.net/reactjs/69z2wepo/
 Without JSX
https://jsfiddle.net/reactjs/5vjqabv3/
 Running Application
https://github.com/rammurat/reactjs-instagram
 Facebook
 Instagram
 BBC
 Coursera
 DailyMotion
 Dropbox
 Feedly
 Flipcart
 Khan Academy
 IMDB
 Paypal
 Reddit
 Salesforce
 Yahoo
 Atlassian
 Discovery
 Ebay
 Tesco
 NetFlix
Questions?
Thank You
What is Next?

More Related Content

What's hot

Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_jsMicroPyramid .
 
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 ITnamespaceit
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux IntroductionNikolaus Graf
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core ConceptsDivyang Bhambhani
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentationBojan Golubović
 
Basics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfBasics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfKnoldus Inc.
 
React state
React  stateReact  state
React stateDucat
 
Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022Fabio Biondi
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation洪 鹏发
 

What's hot (20)

Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
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
 
React js
React jsReact js
React js
 
React + Redux Introduction
React + Redux IntroductionReact + Redux Introduction
React + Redux Introduction
 
reactJS
reactJSreactJS
reactJS
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
React workshop
React workshopReact workshop
React workshop
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Reactjs
ReactjsReactjs
Reactjs
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
React js
React jsReact js
React js
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
React workshop presentation
React workshop presentationReact workshop presentation
React workshop presentation
 
Basics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfBasics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdf
 
React state
React  stateReact  state
React state
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022Redux Toolkit - Quick Intro - 2022
Redux Toolkit - Quick Intro - 2022
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 

Similar to ReactJS

React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today Nitin Tyagi
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React TogetherSebastian Pederiva
 
OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - Reactrbl002
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs[T]echdencias
 
ReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to AwesomenessReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to AwesomenessRonny Haase
 
React - An Introduction
React - An IntroductionReact - An Introduction
React - An IntroductionTyler Johnston
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥Remo Jansen
 
A full introductory guide to React
A full introductory guide to ReactA full introductory guide to React
A full introductory guide to ReactJean Carlo Emer
 
React, Flux and more (p1)
React, Flux and more (p1)React, Flux and more (p1)
React, Flux and more (p1)tuanpa206
 
Content-Driven Apps with React
Content-Driven Apps with ReactContent-Driven Apps with React
Content-Driven Apps with ReactNetcetera
 

Similar to ReactJS (20)

React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
Combining Angular and React Together
Combining Angular and React TogetherCombining Angular and React Together
Combining Angular and React Together
 
OttawaJS - React
OttawaJS - ReactOttawaJS - React
OttawaJS - React
 
Intro react js
Intro react jsIntro react js
Intro react js
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
Intro to React.js
Intro to React.jsIntro to React.js
Intro to React.js
 
React & Redux for noobs
React & Redux for noobsReact & Redux for noobs
React & Redux for noobs
 
ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
 
ReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to AwesomenessReactJS - A quick introduction to Awesomeness
ReactJS - A quick introduction to Awesomeness
 
React - An Introduction
React - An IntroductionReact - An Introduction
React - An Introduction
 
ReactJS.ppt
ReactJS.pptReactJS.ppt
ReactJS.ppt
 
React/Redux
React/ReduxReact/Redux
React/Redux
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
A full introductory guide to React
A full introductory guide to ReactA full introductory guide to React
A full introductory guide to React
 
React outbox
React outboxReact outbox
React outbox
 
React, Flux and more (p1)
React, Flux and more (p1)React, Flux and more (p1)
React, Flux and more (p1)
 
React native
React nativeReact native
React native
 
React
ReactReact
React
 
Content-Driven Apps with React
Content-Driven Apps with ReactContent-Driven Apps with React
Content-Driven Apps with React
 

Recently uploaded

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Recently uploaded (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

ReactJS

  • 1. Ram Murat Sharma | rammurat.rms.sharma0@gmail.com | @rammrms
  • 2.  Introduction to React?  React features  Installation  React philosophy  Coupling vs Cohesion  JSX  Flux  Components  Why components?  React component life cycle ◦ Initial phase ◦ Lifetime phase ◦ Tear Down phase  Data flow  Virtual DOM  States and Props  Events  Final HTML  Angular VS React  Why React?  Where is React?  Questions?  What is Next?
  • 3.  What you should know already ◦ Good knowledge of JavaScript and HTML ◦ Basic understanding of HTML DOM  Technical preparations ◦ Latest Chrome browser on your system ◦ Your preferred IDE ◦ React developer debugger tool (Currently, available for Chrome)
  • 4.
  • 5.
  • 6.  A library for building user interfaces  Designed for View layer  Created by Facebook/Instagram developers  Build reusable & Interactive UI components  Renders your UI and respond to events
  • 7.  Build Components not templates  Re-render on every change  Fast Virtual DOM  Unidirectional data binding  Reusable and Interactive components  Components are loosely coupled and highly cohesive  JSX (Easy to write)  No more explicit DOM operations – everything is declarative  Own debugger
  • 8.  Individual download ◦ <script src="https://fb.me/react-0.14.5.min.js"></script> ◦ <script src="https://fb.me/react-dom-0.14.5.min.js"></script>  npm ◦ npm install –-save react react-dom  bower ◦ bower install –-save react react-dom
  • 9.
  • 10. Coupling The degree to which each program module relies on each of the other modules. Cohesion The degree to which elements of a module belong together.
  • 11.
  • 12.  Writing code made easy and faster  Nothing but writing HTML in JavaScript  It’s not mandatory, you are allowed to write your JavaScript instead JavaScript XML Syntax Transform
  • 13. Flux is the application architecture that Facebook uses for building client-side web applications. It complements React's composable view components by utilizing a unidirectional data flow. It's more of a pattern rather than a formal framework
  • 14. var Hello = React.createClass({ render: function() { return <div>Hello {this.props.name}</div>; } }); ReactDOM.render( <Hello name="World" />, document.getElementById('containe r') ); var Hello = React.createClass({ render: function() { return React.createElement("div",null, "Hello ", this.props.name); } }); ReactDOM.render( <Hello name="World" />, document.getElementById('container') );
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.  Components are reusable  Components are composable  Components are unit testable  Every component has “state” and “props”  Components cab be wrapped using <div>,<span>,<Counter>,<ActionButton>
  • 24.  React follows unidirectional data flow like other MVC framework  Data flow happen from parent to child in components by their state and props  Only immediate parent is allowed to pass the data to it’s children components
  • 25.  React has Virtual DOM and event system  React builds a new virtual DOM subtree on every update  React always compares its virtual DOM on change not actual DOM  Instead of creating new object, react just identify what changes are took place and update the referenced object and DOM accordingly  Optimized for performance and memory footprint  All updates happen trough a batch process
  • 26.
  • 27. States  Every component has default state object.  State can be set by using this.setState() method. Probs  In React props are like the HTML properties.  They are used to pass data between components.  name={value} is used to set the property in component.  this.props.propertyname is used to read values which are passed from its parent.
  • 28. var Hello = React.createClass({ getInitialState: function() { return { author: “”}; }, handleAuthorChange: function(e) { this.setState({author: e.target.value}); },render: function() { return ( <div> <p>Hello {this.props.bookName}</p> <form> <input value={this.state.author} onChange={this.handleAuthorChange}/> </form> </div>; } }); ReactDOM.render( <Hello bookName=“Notebook" />, document.getElementById('container') );
  • 29.  React has its own events.  These events are attached to its components.  These events can trigger methods as per need. Events
  • 31. Feature Angular React Layers MVC V Technology - JSX Core Structure MVC Components Data Flow 2 way Unidirectional Owner Google Facebook/Instagram Architecture - Flux SEO support Phantom JS SEO friendly
  • 32.  Can be used partially for your application  Fast DOM manipulation  Components allows you to separate your entities  Easy to build, grasp and well thought out  SEO friendly – Components can be rendered client side and server side  JSX let you write HTML in JavaScript
  • 33.  JSX https://jsfiddle.net/reactjs/69z2wepo/  Without JSX https://jsfiddle.net/reactjs/5vjqabv3/  Running Application https://github.com/rammurat/reactjs-instagram
  • 34.  Facebook  Instagram  BBC  Coursera  DailyMotion  Dropbox  Feedly  Flipcart  Khan Academy  IMDB  Paypal  Reddit  Salesforce  Yahoo  Atlassian  Discovery  Ebay  Tesco  NetFlix