SlideShare a Scribd company logo
The React Single Page App
React
What is React?
React
An OSS view library built and maintained by Facebook
React
The ‘view’ is built out of components that
are nestable and re-usable
React
React
React
React
React
React
React calls ‘render’ every time state or props is changed.
But it’s only making DOM updates for whatever needs to
change.
It does the diff for this via the vDOM – virtual DOM.
React
React
React
React
React
Complex components without composition are unwieldy.
Use composition.
React
In fact, the whole Single Page App architecture
is one component that composes the rest of the
app.
React
So what happens when things become really
complex?
React
What happens when components need to talk
to each other?
Or when the actions of Component A affect component B?
React & ES6 Intro
React
Direct inter-component communication is messy
and hard to manage.
Let’s take advantage of the fact that our components are
declarative.
React
Basic Solution
Shared data should belong to the common ancestor of
two or more components. The ancestor controls the data
anddefines functions which can modify the data.
Whenever the data updates, the ancestor re-renders itself,
in turn re-rendering its children, which will now have new
props passed to them.
React
How do our components access the modifier functions?
Remember that in Javascript functions are first-class
citizens.
We simply pass the modifier functions down as props
for the children to call as needed.
React
React
React
In a nutshell, this is the pattern for the Single Page App.
There’s a whole tree of components, and, in general,
they all inherit their state and whatever actions are
needed to change state from the root level.
We call that top level the store.
And there’s just one for the whole app.
Redux
Redux – Atomic State Management
Redux
Redux is a Flux-inspired library for creating and managing
our global app state.
At a basic level it provides access to the global state as well as
a dispatcher that accepts actions.
Redux, or Flux
Redux
We’ll come back to how this ties together in the code soon.
There’s a couple other concepts to cover first.
React-Router
First, React Router. It’s a small library that gives us client-side
routingwith pretty URLs. It works by matching routes to
determine which components should be displayed.
React-Router
ES2015/ES2016
Also on the detour: New Javascript!
ES2015/ES2016
You’ll see this interchangeably as ES2015/2016 or ES6/ES7.
Either way,it refers to new additions to Javascript.
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
Using const and let provides useful signals to the dev and the
interpreterabout the intended use of the variable.
There’s no instance where ‘var’ is preferable to either.
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
ES2015/ES2016
We can use all this today!
Browser Compatibility solved with Babel
Walkthrough
Here there was a walkthrough of the specific app
architecture / structure used in the project… skipping.
Post Walkthrough
Some important notes:
• Component render functions should be pure functions and simple.
• The Redux store must be immutable. We can enforce this with
libraries.
• Reducers and action creators should be pure (no side effects).
• Not everything needs to live in the global redux store – just data
that is important to the application flow or to multiple
components. UI state for a single component does not need to live
in the global store.
• Ctrl-H for dev tooling (in dev builds)
• Write unit tests for components, action creators, and reducers!
Post Walkthrough
Thank you!
Questions?

More Related Content

What's hot (6)

PDF
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
Edureka!
 
PPTX
Sps Oslo - Introduce redux in your sp fx solution
Yannick Borghmans
 
PDF
OttawaJS - React
rbl002
 
PPTX
React patterns
Naimish Verma
 
PPTX
Python component in mule
Ramakrishna kapa
 
PPTX
Андрій Рева, "How to build reactive java application"
Sigma Software
 
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
Edureka!
 
Sps Oslo - Introduce redux in your sp fx solution
Yannick Borghmans
 
OttawaJS - React
rbl002
 
React patterns
Naimish Verma
 
Python component in mule
Ramakrishna kapa
 
Андрій Рева, "How to build reactive java application"
Sigma Software
 

Viewers also liked (20)

PDF
React on es6+
Nikolaus Graf
 
PPTX
Presentasi kasus askes
soniamonita
 
PPTX
Cvs
krunal26789
 
PDF
Porposal 2 sheet set sheet - a103 - first floor
joekozelka
 
PDF
Deber anatomia músculos
Jessica Rivera
 
PDF
Yankee doodle
Loveis1able Khumpuangdee
 
ODP
Lucas
Padrereus
 
PPTX
AsburyAgile-Final
Yair Aviner
 
PPTX
Social giving
Lisa Colton
 
PDF
Vaykra dimanche
beithazohar
 
DOC
P U B L I C I T Y D R
sangh1212
 
DOCX
Ingles
UO
 
ODP
Flavia
Padrereus
 
PPTX
Marketing
Oscar Barrios
 
ODP
Michele
Padrereus
 
ODP
Mequias
Padrereus
 
PPTX
Superávit y déficit
Oscar Barrios
 
PPT
Tipos de familias
Oscar Barrios
 
PPTX
Periodico virtual
Franklin Reyes
 
PPT
Importance Of Nutrition In Diabetes
Azam Jafri
 
React on es6+
Nikolaus Graf
 
Presentasi kasus askes
soniamonita
 
Porposal 2 sheet set sheet - a103 - first floor
joekozelka
 
Deber anatomia músculos
Jessica Rivera
 
Lucas
Padrereus
 
AsburyAgile-Final
Yair Aviner
 
Social giving
Lisa Colton
 
Vaykra dimanche
beithazohar
 
P U B L I C I T Y D R
sangh1212
 
Ingles
UO
 
Flavia
Padrereus
 
Marketing
Oscar Barrios
 
Michele
Padrereus
 
Mequias
Padrereus
 
Superávit y déficit
Oscar Barrios
 
Tipos de familias
Oscar Barrios
 
Periodico virtual
Franklin Reyes
 
Importance Of Nutrition In Diabetes
Azam Jafri
 
Ad

Similar to React & ES6 Intro (20)

PPTX
Introduction to react and redux
Cuong Ho
 
PDF
The Road To Redux
Jeffrey Sanchez
 
PDF
React
Amitai Barnea
 
PPTX
Academy PRO: React JS. Redux & Tooling
Binary Studio
 
PPTX
React. Flux. Redux
Andrey Kolodnitsky
 
PPTX
Introduction to Redux.pptx
MohammadImran322154
 
PDF
Getting started with React and Redux
Paddy Lock
 
PDF
[@NaukriEngineering] Flux Architecture
Naukri.com
 
PDF
Manage the Flux of your Web Application: Let's Redux
Commit University
 
PPTX
Reducers+flux=redux
Shmulik Chicvashvili
 
PPTX
Better web apps with React and Redux
Ali Sa'o
 
PDF
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
PDF
Let's discover React and Redux with TypeScript
Mathieu Savy
 
PPTX
React js programming concept
Tariqul islam
 
PDF
ReactRedux.pdf
Arsalan malik
 
PPTX
React/Redux
Durgesh Vaishnav
 
PDF
Reactивная тяга
Vitebsk Miniq
 
PDF
#FrontConf2017 — Enhance your User (and Developer) Experience with React & Redux
phacks
 
PDF
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
bandmvh3697
 
PDF
Redux essentials
Chandan Kumar Rana
 
Introduction to react and redux
Cuong Ho
 
The Road To Redux
Jeffrey Sanchez
 
Academy PRO: React JS. Redux & Tooling
Binary Studio
 
React. Flux. Redux
Andrey Kolodnitsky
 
Introduction to Redux.pptx
MohammadImran322154
 
Getting started with React and Redux
Paddy Lock
 
[@NaukriEngineering] Flux Architecture
Naukri.com
 
Manage the Flux of your Web Application: Let's Redux
Commit University
 
Reducers+flux=redux
Shmulik Chicvashvili
 
Better web apps with React and Redux
Ali Sa'o
 
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
Let's discover React and Redux with TypeScript
Mathieu Savy
 
React js programming concept
Tariqul islam
 
ReactRedux.pdf
Arsalan malik
 
React/Redux
Durgesh Vaishnav
 
Reactивная тяга
Vitebsk Miniq
 
#FrontConf2017 — Enhance your User (and Developer) Experience with React & Redux
phacks
 
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
bandmvh3697
 
Redux essentials
Chandan Kumar Rana
 
Ad

Recently uploaded (20)

DOCX
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
PDF
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
PPTX
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PDF
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PPT
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
PPTX
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
PPT
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
PPTX
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
PDF
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
PPTX
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
PPTX
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
PPTX
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
PDF
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
PPTX
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
PDF
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
PDF
smart lot access control system with eye
rasabzahra
 
PPTX
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
PDF
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
PPTX
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
PDF
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 
8th International Conference on Electrical Engineering (ELEN 2025)
elelijjournal653
 
Basic_Concepts_in_Clinical_Biochemistry_2018كيمياء_عملي.pdf
AdelLoin
 
Solar Thermal Energy System Seminar.pptx
Gpc Purapuza
 
PORTFOLIO Golam Kibria Khan — architect with a passion for thoughtful design...
MasumKhan59
 
PPT2_Metal formingMECHANICALENGINEEIRNG .ppt
Praveen Kumar
 
Product Development & DevelopmentLecture02.pptx
zeeshanwazir2
 
Carmon_Remote Sensing GIS by Mahesh kumar
DhananjayM6
 
Evaluation and thermal analysis of shell and tube heat exchanger as per requi...
shahveer210504
 
Reasons for the succes of MENARD PRESSUREMETER.pdf
majdiamz
 
VITEEE 2026 Exam Details , Important Dates
SonaliSingh127098
 
Introduction to Basic Renewable Energy.pptx
examcoordinatormesu
 
The Role of Information Technology in Environmental Protectio....pptx
nallamillisriram
 
Biomechanics of Gait: Engineering Solutions for Rehabilitation (www.kiu.ac.ug)
publication11
 
DATA BASE MANAGEMENT AND RELATIONAL DATA
gomathisankariv2
 
Pressure Measurement training for engineers and Technicians
AIESOLUTIONS
 
smart lot access control system with eye
rasabzahra
 
265587293-NFPA 101 Life safety code-PPT-1.pptx
chandermwason
 
AI TECHNIQUES FOR IDENTIFYING ALTERATIONS IN THE HUMAN GUT MICROBIOME IN MULT...
vidyalalltv1
 
fatigue in aircraft structures-221113192308-0ad6dc8c.pptx
aviatecofficial
 
MAD Unit - 1 Introduction of Android IT Department
JappanMavani
 

React & ES6 Intro