SlideShare a Scribd company logo
1 of 16
ReactJs
What is React?
•“React is a JavaScript library for creating User Interfaces, open sourced to the world by
Facebook and Instagram team in 2013 ”
• Main goal of React is to make development of UI components easy and modular. It is
intended to ease the process of building large applications using data that changes over
time
• As of January 2015, React and React Native are Facebook’s top two open-source
projects by number of stars on GitHub and 9th most starred project of all time on GitHub is
React.
Using React
• In the previous SPA example,
• Basically a set elements are rendering on click of any link on the app – React groups these elements as
• Component
• As the data changes in app, DOM has to be updated – React handles data very quickly and efficiently
using
• VirtualDOM
• Whenever the data changes, React will take care of updating only the changed parts ‐ Declarative
• It would be easy to debug if the data flows in a single direction – React implements Unidirectional data
flow
Here's why React is great choice to start with…
1) Components:
• In the previous SPA example, a unit of code is rendering on click of any link.
• When building Rich web applications, probably we need to reuse few set of elements, templates and set of
specification and also code should be structured properly that would help us for the enhancement.
• Capability of creating own component is one of the major productivity boost as it gives lot of flexibility to define
and manipulate the component
• Components once created can be combined, nested and reused across a SPA
• React.js takes the concept of components from Shadow DOM and Polymer JS
• Components are the future of web development ‐ fundamental unit of an application and enable developers to
create web applications as a set of reusable components
Here's why React is great choice to start with…
2) React is a great performer
• As we all know, DOM manipulation is expensive and this results in poor performance
• How do we optimize it?
• Updating DOM directly should be avoided
• Here React, rather than updating DOM directly, build an abstract version of it
• React does all the computations in its abstracted DOM and updates the DOM tree accordingly in a very
efficient manner
Here's why React is great choice to start with…
3) Awesome for SEO
• JavaScript frameworks are not SE friendly since search engines have trouble
reading in JavaScript heavy application
• As SPAs rely on JavaScript execution, servers don’t produce all the HTML content
• React resolves this issue as we can run React on server
• No need of Phantom JS and no other modifications are required in the code to
run on server side
Here's why React is great choice to start with…
4) It makes writing JavaScript easier
• React Components and Elements can be written in a special syntax called
JSX
• This technique is a replacement of writing pure JavaScript code and
hence enhances the productivity
•JSX needs less effort to read and write and is transformed into JavaScript
before running in the browser.
Features of React
• Components
• Virtual DOM
• Declarative
• Unidirectional data flow
• Isomorphic friendly
• JSX
Virtual DOM
• Virtual DOM is an abstraction of DOM
Actual DOM updated
APP
Change event
triggered
Updating changes
Virtual DOM
Previous v-tree
New v-tree
Change detected
Virtual DOM
• Virtual DOM is designed for provide a declarative way of representing the DOM for our application, which supports
diff computation, element creation and patch operations for efficient re rendering
• For every changes in the app, it simply creates a new virtual tree, based on the difference between the previous V
- tree and current V - tree it allows us to make the DOM look exactly as described in the new tree.
• Virtual DOM will figure out how to make updates to the DOM efficiently without recreating all of the DOM nodes
• Virtual DOM enhances performance and efficiency by minimizing expensive updates to the DOM
• Hence React is said to be a great performer because it manages a Virtual DOM
Isomorphic rendering
• Code written in JavaScript which can run on both server and client side
Client Side
Server Side
Reactcomponent API
Isomorphic rendering
• This allows us to render React component on both client and server
• The ability to run the same JavaScript code on both the client and the server,
fast initial page load from the server and a great experience on the client
Benefits:
Performance
SEO
Code
maintenance
React is Declarative
• When the data changes, our application doesn’t need to know how to update the elements in the DOM and we
don’t require to write any imperative code to update the changes
• We simply declare how a component should look and React does the updates in the DOM
Unidirectional data flow
• React implements unidirectional data flow and makes application easier by handling all data flow in a single
direction
• The reason behind this is because components are supposed to be immutable and data within them are
unable to change. They will only listen to data which is flowing from upstream and not the data which is coming
from each other
• Here, flux helps in keeping data unidirectional
• This makes React a best framework, for creating highly interactive web applications
JSX
code without JSX: code with JSX:
render() {
return
("h1", {}, "Hello World!!! ");
}
render() {
return
<h1>Hello World!!!</h1>
}
Other features
 Extremely Fast and Responsive
 Composable components
 Simple
 Isomorphic
 Pluggable
 Battle Proven

More Related Content

What's hot

What's hot (20)

Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
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 part 1
React JS part 1React JS part 1
React JS part 1
 
ReactJs
ReactJsReactJs
ReactJs
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React & Redux
React & ReduxReact & Redux
React & Redux
 
React js
React jsReact js
React js
 
React js
React jsReact js
React js
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React and redux
React and reduxReact and redux
React and redux
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
React js
React jsReact js
React js
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
An introduction to React.js
An introduction to React.jsAn introduction to React.js
An introduction to React.js
 

Similar to React js

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
 

Similar to React js (20)

ReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOMReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOM
 
How Can the Hermes Engine Help React Native Apps.
How Can the Hermes Engine Help React Native Apps.How Can the Hermes Engine Help React Native Apps.
How Can the Hermes Engine Help React Native Apps.
 
Learning React - I
Learning React - ILearning React - I
Learning React - I
 
React for .net developers
React for .net developersReact for .net developers
React for .net developers
 
Lecture 9 - ReactJs.pptx
Lecture 9 - ReactJs.pptxLecture 9 - ReactJs.pptx
Lecture 9 - ReactJs.pptx
 
Why do we use react JS on the website_.pdf
Why do we use react JS on the website_.pdfWhy do we use react JS on the website_.pdf
Why do we use react JS on the website_.pdf
 
Top 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web DevelopmentTop 10 Javascript Frameworks For Easy Web Development
Top 10 Javascript Frameworks For Easy Web Development
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
 
FRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JSFRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JS
 
React js vs react native a comparative analysis
React js vs react native a comparative analysisReact js vs react native a comparative analysis
React js vs react native a comparative analysis
 
REACTJS1.ppsx
REACTJS1.ppsxREACTJS1.ppsx
REACTJS1.ppsx
 
Comparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdfComparison Between React Vs Angular.pdf
Comparison Between React Vs Angular.pdf
 
React.js vs node.js
React.js vs node.jsReact.js vs node.js
React.js vs node.js
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
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
 
React DOM/Virtual DOM
React DOM/Virtual DOMReact DOM/Virtual DOM
React DOM/Virtual DOM
 
react js training|react js training in mumbai|
react js training|react js training in mumbai|react js training|react js training in mumbai|
react js training|react js training in mumbai|
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
How to make React Applications SEO-friendly
How to make React Applications SEO-friendlyHow to make React Applications SEO-friendly
How to make React Applications SEO-friendly
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 

Recently uploaded

CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
anilsa9823
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
anilsa9823
 

Recently uploaded (7)

BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Saharaganj Lucknow best sexual service
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Gomti Nagar Lucknow best Night Fun service
 
9892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x79892124323 | Book Call Girls in Juhu and escort services 24x7
9892124323 | Book Call Girls in Juhu and escort services 24x7
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
Call US Pooja 9892124323 ✓Call Girls In Mira Road ( Mumbai ) secure service,
 

React js

  • 2. What is React? •“React is a JavaScript library for creating User Interfaces, open sourced to the world by Facebook and Instagram team in 2013 ” • Main goal of React is to make development of UI components easy and modular. It is intended to ease the process of building large applications using data that changes over time • As of January 2015, React and React Native are Facebook’s top two open-source projects by number of stars on GitHub and 9th most starred project of all time on GitHub is React.
  • 3. Using React • In the previous SPA example, • Basically a set elements are rendering on click of any link on the app – React groups these elements as • Component • As the data changes in app, DOM has to be updated – React handles data very quickly and efficiently using • VirtualDOM • Whenever the data changes, React will take care of updating only the changed parts ‐ Declarative • It would be easy to debug if the data flows in a single direction – React implements Unidirectional data flow
  • 4. Here's why React is great choice to start with… 1) Components: • In the previous SPA example, a unit of code is rendering on click of any link. • When building Rich web applications, probably we need to reuse few set of elements, templates and set of specification and also code should be structured properly that would help us for the enhancement. • Capability of creating own component is one of the major productivity boost as it gives lot of flexibility to define and manipulate the component • Components once created can be combined, nested and reused across a SPA • React.js takes the concept of components from Shadow DOM and Polymer JS • Components are the future of web development ‐ fundamental unit of an application and enable developers to create web applications as a set of reusable components
  • 5. Here's why React is great choice to start with… 2) React is a great performer • As we all know, DOM manipulation is expensive and this results in poor performance • How do we optimize it? • Updating DOM directly should be avoided • Here React, rather than updating DOM directly, build an abstract version of it • React does all the computations in its abstracted DOM and updates the DOM tree accordingly in a very efficient manner
  • 6. Here's why React is great choice to start with… 3) Awesome for SEO • JavaScript frameworks are not SE friendly since search engines have trouble reading in JavaScript heavy application • As SPAs rely on JavaScript execution, servers don’t produce all the HTML content • React resolves this issue as we can run React on server • No need of Phantom JS and no other modifications are required in the code to run on server side
  • 7. Here's why React is great choice to start with… 4) It makes writing JavaScript easier • React Components and Elements can be written in a special syntax called JSX • This technique is a replacement of writing pure JavaScript code and hence enhances the productivity •JSX needs less effort to read and write and is transformed into JavaScript before running in the browser.
  • 8. Features of React • Components • Virtual DOM • Declarative • Unidirectional data flow • Isomorphic friendly • JSX
  • 9. Virtual DOM • Virtual DOM is an abstraction of DOM Actual DOM updated APP Change event triggered Updating changes Virtual DOM Previous v-tree New v-tree Change detected
  • 10. Virtual DOM • Virtual DOM is designed for provide a declarative way of representing the DOM for our application, which supports diff computation, element creation and patch operations for efficient re rendering • For every changes in the app, it simply creates a new virtual tree, based on the difference between the previous V - tree and current V - tree it allows us to make the DOM look exactly as described in the new tree. • Virtual DOM will figure out how to make updates to the DOM efficiently without recreating all of the DOM nodes • Virtual DOM enhances performance and efficiency by minimizing expensive updates to the DOM • Hence React is said to be a great performer because it manages a Virtual DOM
  • 11. Isomorphic rendering • Code written in JavaScript which can run on both server and client side Client Side Server Side Reactcomponent API
  • 12. Isomorphic rendering • This allows us to render React component on both client and server • The ability to run the same JavaScript code on both the client and the server, fast initial page load from the server and a great experience on the client Benefits: Performance SEO Code maintenance
  • 13. React is Declarative • When the data changes, our application doesn’t need to know how to update the elements in the DOM and we don’t require to write any imperative code to update the changes • We simply declare how a component should look and React does the updates in the DOM
  • 14. Unidirectional data flow • React implements unidirectional data flow and makes application easier by handling all data flow in a single direction • The reason behind this is because components are supposed to be immutable and data within them are unable to change. They will only listen to data which is flowing from upstream and not the data which is coming from each other • Here, flux helps in keeping data unidirectional • This makes React a best framework, for creating highly interactive web applications
  • 15. JSX code without JSX: code with JSX: render() { return ("h1", {}, "Hello World!!! "); } render() { return <h1>Hello World!!!</h1> }
  • 16. Other features  Extremely Fast and Responsive  Composable components  Simple  Isomorphic  Pluggable  Battle Proven