SlideShare a Scribd company logo
React + Redux + TypeScript === ♥
An introduction to the development of universal JavaScript
applications with React, Redux & TypeScript
By Remo H. Jansen
Live demo & source code
https://github.com/remojansen/typescript-redux-react-demo
React
A JavaScript library for building user interfaces.
Lots of people use React as the V in MVC.
Makes no assumptions about the rest of your technology stack.
Abstracts away the DOM from you.
Can also render on the server using Node.
Can power native apps using React Native.
One-way reactive data flow.
React.Component
Components are the main building block of a React application.
A component represents a self-contained piece of UI.
Display some data and be able handle some kind of user interaction.
A component can contain child components.
React.Component: Properties
Properties are a Component's configuration. Received from above and immutable..
React.Component: Life cycle
Everything is a tree!
Properties (JSON):
Components (JSX/TSX)
Output (HTML)
React.Component: State, JSX/TSX and Events
The state starts with a default value when a Component mounts.
The state suffers from mutations in time (mostly generated from user events).
A Component manages its own state internally (you could say the state is private).
React.Component: The state problem
The Problem:
Managing the internal state of the components makes them hard to maintain.
Components stop being a “pure function” when we use state: (porps) => HTML
The solution:
Move the state to the parent component and inject it as properties.
Inject properties from the top of the component’s hierarchy.
Redux
Predictable state container for
JavaScript apps.
Applications that behave
consistently.
Run in client, server, and native
easy to test.
Great developer experience.
Unidirectional data flow.
Making the state “global”: The Store
Making the state “global”: The provider
The provider owns the store and makes the it
available to other components (in the
component hierarchy below) using the
@connect() calls.
Redux: @Connect
Components decorated with @connect
are aware of the Store and because of
that we call them smart components.
Dumb components receive their
properties from its parent component
and are not aware of the Store.
Smart components are less reusable.
Redux: Actions and action creators
An action creator is just a function that returns an action (a JSON object). Actions
must have an action type:
Using the makeActionCreator helper:
Redux: Reducers
Actions describe the fact that something happened, but don’t specify how the
application’s state changes in response. This is the job of a reducer.
(Previous State, Action) => new
State
Redux: Summary
The Redux ecosystem: Asynchronous actions
Thunk middleware for Redux https://github.com/gaearon/redux-thunk
The Redux ecosystem: Router
React router for Redux https://github.com/rackt/react-router-redux
The Redux ecosystem: Development tools
Redux Devtools
https://github.com/zalmoxisus/redux-
devtools-extension
React Hot Loader
http://gaearon.github.io/react-hot-
loader/
Questions?
Thanks!
Contact me at www.remojansen.com or @OweR_ReLoaDeD

More Related Content

PDF
ReactJS
Hiten Pratap Singh
 
PDF
React js
Rajesh Kolla
 
PPTX
reactJS
Syam Santhosh
 
PDF
React JS - Introduction
Sergey Romaneko
 
PDF
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Thymeleaf
 
PPTX
Introduction to react_js
MicroPyramid .
 
PDF
React Context API
NodeXperts
 
PDF
TypeScript Introduction
Dmitry Sheiko
 
React js
Rajesh Kolla
 
reactJS
Syam Santhosh
 
React JS - Introduction
Sergey Romaneko
 
Spring I/O 2012: Natural Templating in Spring MVC with Thymeleaf
Thymeleaf
 
Introduction to react_js
MicroPyramid .
 
React Context API
NodeXperts
 
TypeScript Introduction
Dmitry Sheiko
 

What's hot (20)

PDF
An introduction to React.js
Emanuele DelBono
 
PPTX
React workshop
Imran Sayed
 
PDF
Workshop 21: React Router
Visual Engineering
 
PDF
TypeScript - An Introduction
NexThoughts Technologies
 
PDF
TypeScript Best Practices
felixbillon
 
PDF
Introduction to React JS
Bethmi Gunasekara
 
PDF
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
PDF
Introduction to RxJS
Brainhub
 
PDF
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
 
PDF
Understanding react hooks
Samundra khatri
 
PPTX
Introduction to RxJS
Abul Hasan
 
PDF
Lets make a better react form
Yao Nien Chung
 
PPTX
Introduction to React JS for beginners
Varun Raj
 
PPTX
React js programming concept
Tariqul islam
 
PPTX
Intro to React
Eric Westfall
 
PPTX
Typescript ppt
akhilsreyas
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PDF
React & Redux
Federico Bond
 
PPTX
Its time to React.js
Ritesh Mehrotra
 
PDF
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
An introduction to React.js
Emanuele DelBono
 
React workshop
Imran Sayed
 
Workshop 21: React Router
Visual Engineering
 
TypeScript - An Introduction
NexThoughts Technologies
 
TypeScript Best Practices
felixbillon
 
Introduction to React JS
Bethmi Gunasekara
 
TypeScript: coding JavaScript without the pain
Sander Mak (@Sander_Mak)
 
Introduction to RxJS
Brainhub
 
Asynchronous JavaScript Programming with Callbacks & Promises
Hùng Nguyễn Huy
 
Understanding react hooks
Samundra khatri
 
Introduction to RxJS
Abul Hasan
 
Lets make a better react form
Yao Nien Chung
 
Introduction to React JS for beginners
Varun Raj
 
React js programming concept
Tariqul islam
 
Intro to React
Eric Westfall
 
Typescript ppt
akhilsreyas
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
React & Redux
Federico Bond
 
Its time to React.js
Ritesh Mehrotra
 
RxJS & Angular Reactive Forms @ Codemotion 2019
Fabio Biondi
 
Ad

Similar to React + Redux + TypeScript === ♥ (20)

PDF
A React Journey
LinkMe Srl
 
PDF
Fundamental concepts of react js
StephieJohn
 
PPTX
React gsg presentation with ryan jung & elias malik
Lama K Banna
 
PDF
React JS Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
React Interview Question PDF By ScholarHat
Scholarhat
 
PDF
React Native +Redux + ES6 (Updated)
Chiew Carol
 
PDF
Content-Driven Apps with React
Netcetera
 
PDF
React
Amitai Barnea
 
PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
PDF
100 React Interview questions 2024.pptx.pdf
codevincent624
 
PDF
Copy of React_JS_Notes.pdf
suryanarayana272799
 
PPTX
ReactJs
Sahana Banerjee
 
PDF
REACTJS.pdf
ArthyR3
 
PPTX
Introduction to React JS.pptx
SHAIKIRFAN715544
 
PPTX
React, Flux and more (p1)
tuanpa206
 
PPTX
React JS: A Secret Preview
valuebound
 
PDF
Corso su ReactJS
LinkMe Srl
 
PPTX
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
PPTX
Redux Like Us
Heber Silva
 
PPTX
ReactJS
Ram Murat Sharma
 
A React Journey
LinkMe Srl
 
Fundamental concepts of react js
StephieJohn
 
React gsg presentation with ryan jung & elias malik
Lama K Banna
 
React JS Interview Questions PDF By ScholarHat
Scholarhat
 
React Interview Question PDF By ScholarHat
Scholarhat
 
React Native +Redux + ES6 (Updated)
Chiew Carol
 
Content-Driven Apps with React
Netcetera
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
100 React Interview questions 2024.pptx.pdf
codevincent624
 
Copy of React_JS_Notes.pdf
suryanarayana272799
 
REACTJS.pdf
ArthyR3
 
Introduction to React JS.pptx
SHAIKIRFAN715544
 
React, Flux and more (p1)
tuanpa206
 
React JS: A Secret Preview
valuebound
 
Corso su ReactJS
LinkMe Srl
 
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
Redux Like Us
Heber Silva
 
Ad

Recently uploaded (20)

PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
PDF
Protecting the Digital World Cyber Securit
dnthakkar16
 
PDF
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PPTX
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
PPT
Activate_Methodology_Summary presentatio
annapureddyn
 
PDF
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
PDF
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
PDF
Exploring AI Agents in Process Industries
amoreira6
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PPTX
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
PDF
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
PPTX
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
Protecting the Digital World Cyber Securit
dnthakkar16
 
Build Multi-agent using Agent Development Kit
FadyIbrahim23
 
PFAS Reporting Requirements 2026 Are You Submission Ready Certivo.pptx
Certivo Inc
 
Activate_Methodology_Summary presentatio
annapureddyn
 
Micromaid: A simple Mermaid-like chart generator for Pharo
ESUG
 
Presentation about variables and constant.pptx
safalsingh810
 
What to consider before purchasing Microsoft 365 Business Premium_PDF.pdf
Q-Advise
 
Why Use Open Source Reporting Tools for Business Intelligence.pdf
Varsha Nayak
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Exploring AI Agents in Process Industries
amoreira6
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Smart Panchayat Raj e-Governance App.pptx
Rohitnikam33
 
On Software Engineers' Productivity - Beyond Misleading Metrics
Romén Rodríguez-Gil
 
Maximizing Revenue with Marketo Measure: A Deep Dive into Multi-Touch Attribu...
bbedford2
 
oapresentation.pptx
mehatdhavalrajubhai
 
Microsoft Teams Essentials; The pricing and the versions_PDF.pdf
Q-Advise
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 

React + Redux + TypeScript === ♥

  • 1. React + Redux + TypeScript === ♥ An introduction to the development of universal JavaScript applications with React, Redux & TypeScript By Remo H. Jansen
  • 2. Live demo & source code https://github.com/remojansen/typescript-redux-react-demo
  • 3. React A JavaScript library for building user interfaces. Lots of people use React as the V in MVC. Makes no assumptions about the rest of your technology stack. Abstracts away the DOM from you. Can also render on the server using Node. Can power native apps using React Native. One-way reactive data flow.
  • 4. React.Component Components are the main building block of a React application. A component represents a self-contained piece of UI. Display some data and be able handle some kind of user interaction. A component can contain child components.
  • 5. React.Component: Properties Properties are a Component's configuration. Received from above and immutable..
  • 7. Everything is a tree! Properties (JSON): Components (JSX/TSX) Output (HTML)
  • 8. React.Component: State, JSX/TSX and Events The state starts with a default value when a Component mounts. The state suffers from mutations in time (mostly generated from user events). A Component manages its own state internally (you could say the state is private).
  • 9. React.Component: The state problem The Problem: Managing the internal state of the components makes them hard to maintain. Components stop being a “pure function” when we use state: (porps) => HTML The solution: Move the state to the parent component and inject it as properties. Inject properties from the top of the component’s hierarchy.
  • 10. Redux Predictable state container for JavaScript apps. Applications that behave consistently. Run in client, server, and native easy to test. Great developer experience. Unidirectional data flow.
  • 11. Making the state “global”: The Store
  • 12. Making the state “global”: The provider The provider owns the store and makes the it available to other components (in the component hierarchy below) using the @connect() calls.
  • 13. Redux: @Connect Components decorated with @connect are aware of the Store and because of that we call them smart components. Dumb components receive their properties from its parent component and are not aware of the Store. Smart components are less reusable.
  • 14. Redux: Actions and action creators An action creator is just a function that returns an action (a JSON object). Actions must have an action type: Using the makeActionCreator helper:
  • 15. Redux: Reducers Actions describe the fact that something happened, but don’t specify how the application’s state changes in response. This is the job of a reducer. (Previous State, Action) => new State
  • 17. The Redux ecosystem: Asynchronous actions Thunk middleware for Redux https://github.com/gaearon/redux-thunk
  • 18. The Redux ecosystem: Router React router for Redux https://github.com/rackt/react-router-redux
  • 19. The Redux ecosystem: Development tools Redux Devtools https://github.com/zalmoxisus/redux- devtools-extension React Hot Loader http://gaearon.github.io/react-hot- loader/
  • 21. Thanks! Contact me at www.remojansen.com or @OweR_ReLoaDeD

Editor's Notes

  • #5: Think about an online chess game made in HTML. Think about one of the cells in the game board. The cell represents a self-contained piece of UI and therefore can be implemented as a React component. We could represent the cell and a contained figure using the following HTML. That HTML is going to be generated by a React component.