SlideShare ist ein Scribd-Unternehmen logo
1 von 33
React: A Sneak Peak
Jai Santhosh
UI Engineer @ Flipkart
@jaisanth
Meet React.
Not yet another JS framework!
Meet React.
But just a library for creating user
interfaces.
Meet React.
Renders your UI and responds to
events.
Meet React.
a.k.a. The “V” in

MVC
Build components,
not templates
Build components,
not templates
Re-render, don’t mutate
Build components,
not templates
Re-render, don’t mutate
Fast Virtual DOM
Build components, not templates

• Combine DOM generation and display logic.

9
Build components, not templates

• Combine DOM generation and display logic.

• Transform data into interface components.

10
Build components, not templates

• Combine DOM generation and display logic.

• Transform data into interface components.

• Data can come from anywhere.

11
Build components, not templates

12
Build components, not templates

13
JSX
Allows you to write JS & XML
JSX
Allows you to write JS & XML
Together!
JSX
Don’t need to use it as such
JSX
React.DOM.div({}, 'Hello ' + this.props.name)
Re-render, don’t mutate!

• Every component has “state” and “props”.

18
Re-render, don’t mutate!

• Every component has “state” and “props”.

• Acts as an “Immutable DOM”.

19
Re-render, don’t mutate!

• Every component has “state” and “props”.

• Acts as an “Immutable DOM”.

• Re-render the whole app once the state changes.

20
Re-render, don’t mutate!

Data is guaranteed
to update!

21
Re-render, don’t mutate!

Just like the 90’s
Full-page refresh!!

22
Fast Virtual DOM

Virtual DOM
Makes re-rendering on every change fast.

24
Fast Virtual DOM

On every update…
• React builds a new virtual DOM subtree

25
Fast Virtual DOM

On every update…
• React builds a new virtual DOM subtree
• …diffs it with the old one

26
Fast Virtual DOM

On every update…
• React builds a new virtual DOM subtree
• …diffs it with the old one
• …computes the minimal set of DOM
mutations and puts them in a queue

27
Fast Virtual DOM

On every update…
• React builds a new virtual DOM subtree
• …diffs it with the old one
• …computes the minimal set of DOM
mutations and puts them in a queue
• …and batch exexutes all updates
28
Fast Virtual DOM

none to first
• Create Node:
<div
className="first"><span>A Span</span></div>

first to second

• Replace attribute:
className=“second"

className=“first" by

• Replace node:
Span</span> by <p>A Paragraph</p>

<span>A

second to none
• Remove Node:
<div
className="second"><p>A Paragraph</p></div>
29
Fast Virtual DOM

Virtual DOM is simple and fast

30
http://reactjs.org/
#reactjs on Freenode IRC
reactjs on Google Groups
Other helpful links:
• http://swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs/
• https://news.ycombinator.com/item?id=6936975
• https://news.ycombinator.com/item?id=6937921
• http://calendar.perfplanet.com/2013/diff/
Thank You!!

Weitere ähnliche Inhalte

Was ist angesagt?

[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 

Was ist angesagt? (20)

React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
ReactJS
ReactJSReactJS
ReactJS
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
React workshop
React workshopReact workshop
React workshop
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
WEB DEVELOPMENT USING REACT JS
 WEB DEVELOPMENT USING REACT JS WEB DEVELOPMENT USING REACT JS
WEB DEVELOPMENT USING REACT JS
 
A Brief Introduction to React.js
A Brief Introduction to React.jsA Brief Introduction to React.js
A Brief Introduction to React.js
 
React js
React jsReact js
React js
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React js
React jsReact js
React js
 
React js
React jsReact js
React js
 

Andere mochten auch

Andere mochten auch (6)

An Introduction to ReactJS
An Introduction to ReactJSAn Introduction to ReactJS
An Introduction to ReactJS
 
SpringPeople Introduction to Spring Framework
SpringPeople Introduction to Spring FrameworkSpringPeople Introduction to Spring Framework
SpringPeople Introduction to Spring Framework
 
Introduction To Spring Enterprise Integration - SpringPeople
Introduction To Spring Enterprise Integration - SpringPeopleIntroduction To Spring Enterprise Integration - SpringPeople
Introduction To Spring Enterprise Integration - SpringPeople
 
Introduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeopleIntroduction To Angular.js - SpringPeople
Introduction To Angular.js - SpringPeople
 
React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
ReactJS Tutorial For Beginners | ReactJS Redux Training For Beginners | React...
 

Ähnlich wie React js

Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
Ritesh Kumar
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 

Ähnlich wie React js (20)

Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshop
 
What is virtual dom in react js
What is virtual dom in react jsWhat is virtual dom in react js
What is virtual dom in react js
 
ReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page ApplicationsReactJS.NET - Fast and Scalable Single Page Applications
ReactJS.NET - Fast and Scalable Single Page Applications
 
All the reasons for choosing react js that you didn't know about - Avi Marcus...
All the reasons for choosing react js that you didn't know about - Avi Marcus...All the reasons for choosing react js that you didn't know about - Avi Marcus...
All the reasons for choosing react js that you didn't know about - Avi Marcus...
 
Reactjs workshop (1)
Reactjs workshop (1)Reactjs workshop (1)
Reactjs workshop (1)
 
ReactJS Code Impact
ReactJS Code ImpactReactJS Code Impact
ReactJS Code Impact
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop
 
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
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Performance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React ApplicationsPerformance and Scalability Art of Isomorphic React Applications
Performance and Scalability Art of Isomorphic React Applications
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
Virtual Dom|Browser DOM What are these in React Js?
Virtual Dom|Browser DOM What are these in React Js? Virtual Dom|Browser DOM What are these in React Js?
Virtual Dom|Browser DOM What are these in React Js?
 
Incremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentIncremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend Development
 
React DOM/Virtual DOM
React DOM/Virtual DOMReact DOM/Virtual DOM
React DOM/Virtual DOM
 

Mehr von Jai Santhosh (6)

Context with Yahoo! BOSS
Context with Yahoo! BOSSContext with Yahoo! BOSS
Context with Yahoo! BOSS
 
BOSS around the web
BOSS around the webBOSS around the web
BOSS around the web
 
YUI Tidbits
YUI TidbitsYUI Tidbits
YUI Tidbits
 
YUI (Advanced)
YUI (Advanced)YUI (Advanced)
YUI (Advanced)
 
YQL & Yahoo! Apis
YQL & Yahoo! ApisYQL & Yahoo! Apis
YQL & Yahoo! Apis
 
Hack with YUI
Hack with YUIHack with YUI
Hack with YUI
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Kürzlich hochgeladen (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
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...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

React js

Hinweis der Redaktion

  1. No fb
  2. Or: mixing markup and display logic
  3. Or: mixing markup and display logic
  4. Or: mixing markup and display logic
  5. ----- Meeting Notes (9/9/13 12:00) ----- nowhere in this example is the dom node for count explicitly updated