SlideShare a Scribd company logo
1 of 18
A Brief Introduction
to React.js
SQUARES CONFERENCE 2015
DOUG NEINER –
@DOUGNEINER
What is React?
A React Component
var Blog = React.createClass({
render: function() {
return <Post id="123" type="quote">
<Author name="Doug Neiner" />
<PostContent text="..." />
</Post>;
}
});
A React Component
<Post id="123" type="quote">
<Author name="Doug Neiner" />
<PostContent text="..." />
</Post>
React is similar…
• Tree Structure
• Custom DOM Elements
• Controlled via props (similar to HTML attributes)
• Empty and Non-empty components
React is different…
• Owner-Ownee vs Parents-Children
• Special attributes: key and refs
Componentization
What makes React special?
JSX
var Blog = React.createClass({
render: function() {
return <Post id="123" type="quote">
<Author name="Doug Neiner" />
<PostContent text="..." />
</Post>;
}
});
“We strongly believe that components are the right way to
separate concerns rather than "templates" and "display logic."
We think that markup and the code that generates it are
intimately tied together. Additionally, display logic is often
very complex and using template languages to express it
becomes cumbersome.” – React Docs
JSX is optional
var Blog = React.createClass({
render: function() {
return <Post id="123" type="quote">
<Author name="Doug Neiner" />
<PostContent text="..." />
</Post>;
}
});
JSX is optional
var Blog = React.createClass({
render: function() {
return React.createElement(Post, {id: "123", type: "quote"},
React.createElement(Author, {name: "Doug Neiner"}),
React.createElement(PostContent, {text: "..."})
);
}
});
JSX Gotchas
• Empty elements must include the closing slash: <MyElement />
• class and for attributes are reserved in JavaScript,
so they are written as className and htmlFor in JSX
• The style attribute takes an object literal of key/values not a string
• There are more:
• http://facebook.github.io/react/docs/dom-differences.html
• http://facebook.github.io/react/docs/jsx-gotchas.html
Virtual DOM
• Re-render on change vs. mutate
• Render is a description
• Increases predicability
Unidirectional Data Flow
• Changes always flow down to via props, never up
• Callbacks and actions will flow up
Synthetic event system
• Events are normalized across browsers
• Events are passed into components as props
• Events are automatically delegated
At this point, I switched to live code and
showed how to start with a static comp
and turn it into a React component.
No slides for this part, sorry!
Thank You
Twitter: @dougneiner
Email: doug@dougneiner.com
Github: dcneiner

More Related Content

What's hot (20)

React JS - Introduction
React JS - IntroductionReact JS - Introduction
React JS - Introduction
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Reactjs
Reactjs Reactjs
Reactjs
 
WEB DEVELOPMENT USING REACT JS
 WEB DEVELOPMENT USING REACT JS WEB DEVELOPMENT USING REACT JS
WEB DEVELOPMENT USING REACT JS
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
[Final] ReactJS presentation
[Final] ReactJS presentation[Final] ReactJS presentation
[Final] ReactJS presentation
 
React js
React jsReact js
React js
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React state
React  stateReact  state
React state
 
React js
React jsReact js
React js
 
Reactjs
ReactjsReactjs
Reactjs
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
ReactJs
ReactJsReactJs
ReactJs
 

Similar to A Brief Introduction to React.js

Web Components v1
Web Components v1Web Components v1
Web Components v1Mike Wilcox
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today Nitin Tyagi
 
SenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark Brocato
SenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark BrocatoSenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark Brocato
SenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark BrocatoSencha
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryjanet736113
 
Academy PRO: React JS
Academy PRO: React JSAcademy PRO: React JS
Academy PRO: React JSBinary Studio
 
Styling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS EditionStyling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS Editionbensmithett
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlIlia Idakiev
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Foreverstephskardal
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...SPTechCon
 
[@IndeedEng] Building Indeed Resume Search
[@IndeedEng] Building Indeed Resume Search[@IndeedEng] Building Indeed Resume Search
[@IndeedEng] Building Indeed Resume Searchindeedeng
 
Frontend meetup 2014.06.25
Frontend meetup 2014.06.25Frontend meetup 2014.06.25
Frontend meetup 2014.06.25EU Edge
 
Webcomponents at Frontend meetup 2014.06.25
Webcomponents at Frontend meetup 2014.06.25Webcomponents at Frontend meetup 2014.06.25
Webcomponents at Frontend meetup 2014.06.25Robert Szaloki
 

Similar to A Brief Introduction to React.js (20)

Web Components v1
Web Components v1Web Components v1
Web Components v1
 
ReactJS
ReactJSReactJS
ReactJS
 
ReactJS.ppt
ReactJS.pptReactJS.ppt
ReactJS.ppt
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
SenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark Brocato
SenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark BrocatoSenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark Brocato
SenchaCon 2016: Ext JS + React: A Match Made in UX Heaven - Mark Brocato
 
jquery.ppt
jquery.pptjquery.ppt
jquery.ppt
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
Academy PRO: React JS
Academy PRO: React JSAcademy PRO: React JS
Academy PRO: React JS
 
Intro to React.js
Intro to React.jsIntro to React.js
Intro to React.js
 
Styling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS EditionStyling Components with JavaScript: MelbCSS Edition
Styling Components with JavaScript: MelbCSS Edition
 
Creating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-htmlCreating lightweight JS Apps w/ Web Components and lit-html
Creating lightweight JS Apps w/ Web Components and lit-html
 
J query
J queryJ query
J query
 
jQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends ForeverjQuery and Rails: Best Friends Forever
jQuery and Rails: Best Friends Forever
 
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
Advanced SharePoint 2010 and 2013 Web Part Development by Rob Windsor - SPTec...
 
[@IndeedEng] Building Indeed Resume Search
[@IndeedEng] Building Indeed Resume Search[@IndeedEng] Building Indeed Resume Search
[@IndeedEng] Building Indeed Resume Search
 
Frontend meetup 2014.06.25
Frontend meetup 2014.06.25Frontend meetup 2014.06.25
Frontend meetup 2014.06.25
 
Webcomponents at Frontend meetup 2014.06.25
Webcomponents at Frontend meetup 2014.06.25Webcomponents at Frontend meetup 2014.06.25
Webcomponents at Frontend meetup 2014.06.25
 

Recently uploaded

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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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 productivityPrincipled Technologies
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
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
 

Recently uploaded (20)

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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
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
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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...
 

A Brief Introduction to React.js

  • 1. A Brief Introduction to React.js SQUARES CONFERENCE 2015 DOUG NEINER – @DOUGNEINER
  • 3. A React Component var Blog = React.createClass({ render: function() { return <Post id="123" type="quote"> <Author name="Doug Neiner" /> <PostContent text="..." /> </Post>; } });
  • 4. A React Component <Post id="123" type="quote"> <Author name="Doug Neiner" /> <PostContent text="..." /> </Post>
  • 5. React is similar… • Tree Structure • Custom DOM Elements • Controlled via props (similar to HTML attributes) • Empty and Non-empty components
  • 6. React is different… • Owner-Ownee vs Parents-Children • Special attributes: key and refs
  • 8. What makes React special?
  • 9. JSX var Blog = React.createClass({ render: function() { return <Post id="123" type="quote"> <Author name="Doug Neiner" /> <PostContent text="..." /> </Post>; } });
  • 10. “We strongly believe that components are the right way to separate concerns rather than "templates" and "display logic." We think that markup and the code that generates it are intimately tied together. Additionally, display logic is often very complex and using template languages to express it becomes cumbersome.” – React Docs
  • 11. JSX is optional var Blog = React.createClass({ render: function() { return <Post id="123" type="quote"> <Author name="Doug Neiner" /> <PostContent text="..." /> </Post>; } });
  • 12. JSX is optional var Blog = React.createClass({ render: function() { return React.createElement(Post, {id: "123", type: "quote"}, React.createElement(Author, {name: "Doug Neiner"}), React.createElement(PostContent, {text: "..."}) ); } });
  • 13. JSX Gotchas • Empty elements must include the closing slash: <MyElement /> • class and for attributes are reserved in JavaScript, so they are written as className and htmlFor in JSX • The style attribute takes an object literal of key/values not a string • There are more: • http://facebook.github.io/react/docs/dom-differences.html • http://facebook.github.io/react/docs/jsx-gotchas.html
  • 14. Virtual DOM • Re-render on change vs. mutate • Render is a description • Increases predicability
  • 15. Unidirectional Data Flow • Changes always flow down to via props, never up • Callbacks and actions will flow up
  • 16. Synthetic event system • Events are normalized across browsers • Events are passed into components as props • Events are automatically delegated
  • 17. At this point, I switched to live code and showed how to start with a static comp and turn it into a React component. No slides for this part, sorry!
  • 18. Thank You Twitter: @dougneiner Email: doug@dougneiner.com Github: dcneiner

Editor's Notes

  1. React.js is an ultra-fast view layer for modern web applications. It is a library, not a framework – so it seeks to solve the challenges around the UI layer without encroaching on the rest of your application. It describes itself as the V in MVC, but for certain use cases, it can be used to power the whole app (Though at LeanKit, it lives strictly as the View layer since we use the Flux architecture pattern via Flux.js).
  2. Notice the part that looks like JavaScript? Notice the part that looks like HTML? Try to forget they are in the same file for a bit. We’ll cover why that is later! But this is a simple React component that is utilizing three other React components, Post, Author, and PostContent.
  3. Focus on this for now. Just the part that looks like HTML as we try to establish some comparisons based on what you already know about the DOM.
  4. 1. React can be visualized as a tree structure similar to DOM. Components that contain other components which in turn may contain other components. 2. React components can be thought of as custom DOM elements, but by the time they hit the actual page they are just plain DOM elements – nothing like custom HTML5 DOM elements. 3. React components can be configured from the outside using their form of attributes called props. Just like you might set a `type` on an input, you can set a prop on a component.
  5. We would never say a <div> owns a child <a>, but in React, components that are responsible for setting the props of other components are called owners. There are some extra props that you won’t find in HTML, but we won’t get into this much today.
  6. You are probably already pretty good at this… We have found a pretty close parallel at LeanKit between CSS class names and our components. If you use BEM, OOCSS or SMACSS understanding how to split your UI into discrete and right-sized components should come pretty naturally.
  7. A JavaScript syntax extension that will transpile into pure JS before its loaded into the browser.
  8. Regarding the old approach of keeping HTML and JS separate, Pete Hunt said its not about separation of concerns but rather separation of technologies. The concerns are the same concerns for both the traditional template and the code it pairs with.
  9. This turns into…
  10. … this. And you can skip JSX and just write this, but most folks generally don’t.
  11. The render methods return a description of what the DOM should look like. This is used to construct a Virtual DOM (Also referred to by the React docs as a Mock DOM). Then, when state changes, and the tree is re-rendered, the new Virtual DOM is compared to the old Virtual DOM and the smallest number of changes is produced. Its a common misconception that the new Virtual DOM is always compared to the actual DOM, when it is actual compared to the previous Virtual DOM. 1. This makes your app very easy to reason about. Given the same state and props, your component will render the same way every time. 2. Clicking a button no longer "dismisses the dialog" – It changes a value in state, that when re-rendered, will result in the dialog going away. 3. We think of "render" as "update visuals", but the render method just returns a snapshot of what the DOM *should* look like at that point. If nothing changed, no changes will be made to the page.
  12. 1. Changes in a React app flow one direction, from some part of the tree down – never up. Triggers (or actions as they are often called) can bubble up (via callbacks, messaging, or dispatcher), but any resulting change starts in one location and flows down. 2. This makes the app very easy to reason about and very predictable.
  13. 1. Events that behave the same across browsers 2. Event handlers are passed into components as props, and might look like how you've been told NOT to do thing – but in reality it wires them up correctly using delegation. You don’t need multiple handlers on the same element as you control the handler in your component.