SlideShare a Scribd company logo
React Components,
Flux, and Isomorphism
Federico Torre
React Components
component = view + controller
• Forget MVC, think components.
• Component = view/html + controller/js
• JSX (sugar syntax that gets compiled to JS)
React Components
React Components
• Very modular .:. reusable
• State based .:. predictable
• Independent .:. testable
• High-performance, thanks to virtual DOM
Listing Card
Photo Gallery
React Components
• Based on state (props and state)
• Uni-directional (re-renders every change*)
• Composable (components in components)
• Reusable (thanks to props)
React Components
React Components
Component Data
• State — contained within a component; used to
track changes within a component
• Props — passed in from parent; think of these as
arguments, or inputs to a component; do not
change
Summarizing Components
• Very modular .:. reusable
• State based .:. predictable
• Independent .:. testable
• High-performance, thanks to virtual DOM
Can pass data down to children via props, but …

what about coordinating parallel components….?
Listing Card
Photo Gallery
Flux
flux = actions + stores
Why Flux?
• Component’s source of truth
• Ties components together
• Flux = Actions + Stores 101 Main St, $3500
102 Main St, $3800
Showing 2 favorites
DataStore
{favorites: [
{title: ‘101 main st’,
price: ‘3500’},
{title: ‘101 main st’,
price: ‘3500’}
]}
Flux
Available app-wide. We use Fluxxor.
• Actions — things to do; api calls for example
• Stores — one source of truth; all app data
• and constants (aka dispatcher)
Using Flux
Flux: Actions
Actions dispatch events
with payloads to stores.
Api calls will usually be
called in actions.
Flux: Stores
Application-wide data
management (aka models)
Components pull data in to
their own state from stores.
Store methods manipulate
store state &emit changes.
Flux: Constants
Literally, just constants.
Using Flux
Using Flux
User clicks
Component
calls action
Action
dispatches
event
Store
receives
event with
payload
Store
updates data,
emits change
Component
re-renders
with new
state
Isomorphism
one code base for client and server rendering
Isomorphism
Client side rendering
• Javascript app running
in browser
• Slow initial load :/
• New pages are quick
— just fetch json data
Server side rendering
• Generate page on
server
• Quick initial page load
• SEO works
• HTTP request for each
new page :/
Why not have both?
We use react-router for client-side & server-side routing.
Isomorphism
On the server, pass
everything to the react
app.
React.renderToString()
— view/html only; no
js/ui.
Isomorphism
react-router routes (key to the whole app)
Router.run() uses this to identify which components to render based on url
Isomorphism
Isomorphism
On the client load, run Router.run() again with the same data.
This time, React.render() — injects view/html + js/ui.
Federico Torre
ftorre104@gmail.com
832-606-0294

More Related Content

What's hot (20)

PPTX
Reactjs
Neha Sharma
 
PDF
Introduce Flux & react in practices (KKBOX)
Hsuan Fu Lien
 
PDF
Redux Universal
Nikolaus Graf
 
PPTX
React js
Alireza Akbari
 
PPTX
A Brief Introduction to React.js
Doug Neiner
 
PDF
React.js
Łukasz Kużyński
 
PPTX
React-JS Component Life-cycle Methods
ANKUSH CHAVAN
 
PPTX
React JS: A Secret Preview
valuebound
 
PDF
Using redux
Jonas Ohlsson Aden
 
PPTX
Scaling React and Redux at IOOF
Vivian Farrell
 
PPT
React js
Jai Santhosh
 
PPTX
Academy PRO: React JS
Binary Studio
 
PDF
React js
Rajesh Kolla
 
PDF
Learning React - I
Mitch Chen
 
PPTX
Intro to React
Eric Westfall
 
PPTX
001. Introduction about React
Binh Quan Duc
 
PPTX
React js
Nikhil Karkra
 
PPT
Starting with Reactjs
Thinh VoXuan
 
PDF
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
PPTX
reactJS
Syam Santhosh
 
Reactjs
Neha Sharma
 
Introduce Flux & react in practices (KKBOX)
Hsuan Fu Lien
 
Redux Universal
Nikolaus Graf
 
React js
Alireza Akbari
 
A Brief Introduction to React.js
Doug Neiner
 
React-JS Component Life-cycle Methods
ANKUSH CHAVAN
 
React JS: A Secret Preview
valuebound
 
Using redux
Jonas Ohlsson Aden
 
Scaling React and Redux at IOOF
Vivian Farrell
 
React js
Jai Santhosh
 
Academy PRO: React JS
Binary Studio
 
React js
Rajesh Kolla
 
Learning React - I
Mitch Chen
 
Intro to React
Eric Westfall
 
001. Introduction about React
Binh Quan Duc
 
React js
Nikhil Karkra
 
Starting with Reactjs
Thinh VoXuan
 
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
reactJS
Syam Santhosh
 

Viewers also liked (6)

PDF
React Router: React Meetup XXL
Rob Gietema
 
PPTX
Building Open-Source React Components
Zack Argyle
 
PDF
ReactJS presentation
Thanh Tuong
 
PPTX
React + Redux Introduction
Nikolaus Graf
 
PDF
React JS and why it's awesome
Andrew Hull
 
PPTX
Flux with RxSwift
Yuji Hato
 
React Router: React Meetup XXL
Rob Gietema
 
Building Open-Source React Components
Zack Argyle
 
ReactJS presentation
Thanh Tuong
 
React + Redux Introduction
Nikolaus Graf
 
React JS and why it's awesome
Andrew Hull
 
Flux with RxSwift
Yuji Hato
 
Ad

Similar to Introduction to React, Flux, and Isomorphic Apps (20)

PPTX
ReactJS - Re-rendering pages in the age of the mutable DOM
Marc Cyr
 
PDF
React & Flux Workshop
Christian Lilley
 
ODP
Fluxxor react library
Karthick Kumar
 
PPTX
ReactJS Code Impact
Raymond McDermott
 
PDF
An Intense Overview of the React Ecosystem
Rami Sayar
 
PPTX
ReactJS
Ram Murat Sharma
 
PDF
From Back to Front: Rails To React Family
Khor SoonHin
 
PPTX
ReactJS
Fatih Şimşek
 
PPTX
React.js at Cortex
Geoff Harcourt
 
PPTX
What is flux architecture in react
BOSC Tech Labs
 
PPTX
React. Flux. Redux. by Andrey Kolodnitskiy
Valeriia Maliarenko
 
PPTX
React + Flux = Joy
John Need
 
PPTX
React. Flux. Redux
Andrey Kolodnitsky
 
PDF
Fluxible
Taylor Lovett
 
PDF
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
 
PPT
Flux architecture
Badr Zaman [Front End , J2EE ]
 
PDF
An Overview of the React Ecosystem
FITC
 
PPTX
Flux and React.js
sara stanford
 
PDF
React + flux
Daniel Werthen
 
ReactJS - Re-rendering pages in the age of the mutable DOM
Marc Cyr
 
React & Flux Workshop
Christian Lilley
 
Fluxxor react library
Karthick Kumar
 
ReactJS Code Impact
Raymond McDermott
 
An Intense Overview of the React Ecosystem
Rami Sayar
 
From Back to Front: Rails To React Family
Khor SoonHin
 
React.js at Cortex
Geoff Harcourt
 
What is flux architecture in react
BOSC Tech Labs
 
React. Flux. Redux. by Andrey Kolodnitskiy
Valeriia Maliarenko
 
React + Flux = Joy
John Need
 
React. Flux. Redux
Andrey Kolodnitsky
 
Fluxible
Taylor Lovett
 
TPSE Thailand 2015 - Rethinking Web with React and Flux
Jirat Kijlerdpornpailoj
 
An Overview of the React Ecosystem
FITC
 
Flux and React.js
sara stanford
 
React + flux
Daniel Werthen
 
Ad

Recently uploaded (20)

PDF
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
PPTX
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
PDF
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
PDF
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
DOCX
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
PDF
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
PPTX
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
PPTX
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
PPTX
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
PPTX
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
PDF
The Internet - By the numbers, presented at npNOG 11
APNIC
 
PDF
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
PPTX
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
PDF
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
PPTX
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
PDF
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
PDF
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
PDF
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
PDF
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
PPTX
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 
FutureCon Seattle 2025 Presentation Slides - You Had One Job
Suzanne Aldrich
 
Presentation3gsgsgsgsdfgadgsfgfgsfgagsfgsfgzfdgsdgs.pptx
SUB03
 
Digital burnout toolkit for youth workers and teachers
asociatiastart123
 
BRKSP-2551 - Introduction to Segment Routing.pdf
fcesargonca
 
Custom vs. Off-the-Shelf Banking Software
KristenCarter35
 
BRKACI-1003 ACI Brownfield Migration - Real World Experiences and Best Practi...
fcesargonca
 
Lec15_Mutability Immutability-converted.pptx
khanjahanzaib1
 
Softuni - Psychology of entrepreneurship
Kalin Karakehayov
 
法国巴黎第二大学本科毕业证{Paris 2学费发票Paris 2成绩单}办理方法
Taqyea
 
Metaphysics_Presentation_With_Visuals.pptx
erikjohnsales1
 
The Internet - By the numbers, presented at npNOG 11
APNIC
 
Enhancing Parental Roles in Protecting Children from Online Sexual Exploitati...
ICT Frame Magazine Pvt. Ltd.
 
PHIPA-Compliant Web Hosting in Toronto: What Healthcare Providers Must Know
steve198109
 
BRKACI-1001 - Your First 7 Days of ACI.pdf
fcesargonca
 
Networking_Essentials_version_3.0_-_Module_3.pptx
ryan622010
 
Cleaning up your RPKI invalids, presented at PacNOG 35
APNIC
 
Top 10 Testing Procedures to Ensure Your Magento to Shopify Migration Success...
CartCoders
 
BRKAPP-1102 - Proactive Network and Application Monitoring.pdf
fcesargonca
 
Boardroom AI: The Next 10 Moves | Cerebraix Talent Tech
ssuser73bdb11
 
04 Output 1 Instruments & Tools (3).pptx
GEDYIONGebre
 

Introduction to React, Flux, and Isomorphic Apps