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

PPTX
React gsg presentation with ryan jung & elias malik
PDF
Project Report
PPTX
Spring reactor
PPTX
PDF
Meetup dpjs react_api
PPTX
SharePoint Framework y React
PPTX
React native - Unleash the power of your device
PPTX
GraphQL Introduction with Spring Boot
React gsg presentation with ryan jung & elias malik
Project Report
Spring reactor
Meetup dpjs react_api
SharePoint Framework y React
React native - Unleash the power of your device
GraphQL Introduction with Spring Boot

What's hot (6)

PDF
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
PPTX
Sps Oslo - Introduce redux in your sp fx solution
PDF
OttawaJS - React
PPTX
React patterns
PPTX
Python component in mule
PPTX
Андрій Рева, "How to build reactive java application"
React Redux Tutorial | Redux Tutorial for Beginners | React Redux Training | ...
Sps Oslo - Introduce redux in your sp fx solution
OttawaJS - React
React patterns
Python component in mule
Андрій Рева, "How to build reactive java application"
Ad

Viewers also liked (20)

PDF
React on es6+
PPTX
Presentasi kasus askes
PPTX
PDF
Porposal 2 sheet set sheet - a103 - first floor
PDF
Deber anatomia músculos
PDF
ODP
Lucas
PPTX
AsburyAgile-Final
PPTX
Social giving
PDF
Vaykra dimanche
DOC
P U B L I C I T Y D R
DOCX
Ingles
 
ODP
Flavia
PPTX
Marketing
ODP
Michele
ODP
Mequias
PPTX
Superávit y déficit
PPT
Tipos de familias
PPTX
Periodico virtual
PPT
Importance Of Nutrition In Diabetes
React on es6+
Presentasi kasus askes
Porposal 2 sheet set sheet - a103 - first floor
Deber anatomia músculos
Lucas
AsburyAgile-Final
Social giving
Vaykra dimanche
P U B L I C I T Y D R
Ingles
 
Flavia
Marketing
Michele
Mequias
Superávit y déficit
Tipos de familias
Periodico virtual
Importance Of Nutrition In Diabetes
Ad

Similar to React & ES6 Intro (20)

PDF
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
PDF
Techpaathshala ReactJS .pdf
PDF
A React Journey
PDF
React JS Interview Questions PDF By ScholarHat
PDF
React Interview Question PDF By ScholarHat
PPTX
React-JS.pptx
PPTX
Introduction to ReactJS UI Web Dev .pptx
PDF
JOSA TechTalks - Better Web Apps with React and Redux
PPTX
Better web apps with React and Redux
PPTX
Introduction to React JS.pptx
PDF
learning react
PDF
Corso su ReactJS
PPTX
React JS - A quick introduction tutorial
PDF
100 React Interview questions 2024.pptx.pdf
DOCX
Skill practical javascript diy projects
PDF
React Interview Question & Answers PDF By ScholarHat
PPTX
React + Redux + TypeScript === ♥
PPTX
PDF
Maximize Development Efficiency with ReactJS.pdf
PPTX
React js introduction about it's features
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
Techpaathshala ReactJS .pdf
A React Journey
React JS Interview Questions PDF By ScholarHat
React Interview Question PDF By ScholarHat
React-JS.pptx
Introduction to ReactJS UI Web Dev .pptx
JOSA TechTalks - Better Web Apps with React and Redux
Better web apps with React and Redux
Introduction to React JS.pptx
learning react
Corso su ReactJS
React JS - A quick introduction tutorial
100 React Interview questions 2024.pptx.pdf
Skill practical javascript diy projects
React Interview Question & Answers PDF By ScholarHat
React + Redux + TypeScript === ♥
Maximize Development Efficiency with ReactJS.pdf
React js introduction about it's features

Recently uploaded (20)

DOCX
573137875-Attendance-Management-System-original
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Construction Project Organization Group 2.pptx
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPT
Project quality management in manufacturing
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Digital Logic Computer Design lecture notes
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
573137875-Attendance-Management-System-original
Mechanical Engineering MATERIALS Selection
Foundation to blockchain - A guide to Blockchain Tech
Construction Project Organization Group 2.pptx
Arduino robotics embedded978-1-4302-3184-4.pdf
Project quality management in manufacturing
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Lecture Notes Electrical Wiring System Components
Digital Logic Computer Design lecture notes
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
bas. eng. economics group 4 presentation 1.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx

React & ES6 Intro