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

What's hot (20)

PDF
Introduction to React JS
Bethmi Gunasekara
 
PDF
Angular & RXJS: examples and use cases
Fabio Biondi
 
PPTX
Intro to React
Eric Westfall
 
PDF
React js
Rajesh Kolla
 
PDF
An introduction to React.js
Emanuele DelBono
 
PPTX
React hooks
Ramy ElBasyouni
 
PDF
Angular and The Case for RxJS
Sandi Barr
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
ODP
Introduction to ReactJS
Knoldus Inc.
 
PPTX
Introduction to React JS for beginners
Varun Raj
 
PPTX
React js
Oswald Campesato
 
PDF
React JS - Introduction
Sergey Romaneko
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PPTX
React js for beginners
Alessandro Valenti
 
PDF
Introduction to Redux
Ignacio Martín
 
PDF
Workshop 21: React Router
Visual Engineering
 
PPTX
ReactJs
Sahana Banerjee
 
PPTX
Reactjs
Mallikarjuna G D
 
PPTX
React js
Alireza Akbari
 
Introduction to React JS
Bethmi Gunasekara
 
Angular & RXJS: examples and use cases
Fabio Biondi
 
Intro to React
Eric Westfall
 
React js
Rajesh Kolla
 
An introduction to React.js
Emanuele DelBono
 
React hooks
Ramy ElBasyouni
 
Angular and The Case for RxJS
Sandi Barr
 
ReactJS presentation.pptx
DivyanshGupta922023
 
Introduction to ReactJS
Knoldus Inc.
 
Introduction to React JS for beginners
Varun Raj
 
React JS - Introduction
Sergey Romaneko
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
React js for beginners
Alessandro Valenti
 
Introduction to Redux
Ignacio Martín
 
Workshop 21: React Router
Visual Engineering
 
React js
Alireza Akbari
 

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

PDF
A React Journey
LinkMe Srl
 
PDF
Fundamental concepts of react js
StephieJohn
 
PPTX
React js programming concept
Tariqul islam
 
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
reactJS
Syam Santhosh
 
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
 
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
 
A React Journey
LinkMe Srl
 
Fundamental concepts of react js
StephieJohn
 
React js programming concept
Tariqul islam
 
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
 
reactJS
Syam Santhosh
 
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)

PPTX
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
 
PPTX
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
 
PPTX
For my supp to finally picking supp that work
necas19388
 
PDF
Automated Test Case Repair Using Language Models
Lionel Briand
 
PPTX
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
PDF
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
PDF
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
PDF
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
PDF
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
PPTX
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
 
PPTX
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
PPTX
Automatic_Iperf_Log_Result_Excel_visual_v2.pptx
Chen-Chih Lee
 
PPTX
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
PDF
Laboratory Workflows Digitalized and live in 90 days with Scifeon´s SAPPA P...
info969686
 
PDF
From Chaos to Clarity: Mastering Analytics Governance in the Modern Enterprise
Wiiisdom
 
PPTX
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
PDF
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
PDF
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
PPTX
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
PDF
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
Android Notifications-A Guide to User-Facing Alerts in Android .pptx
Nabin Dhakal
 
Iobit Driver Booster Pro 12 Crack Free Download
chaudhryakashoo065
 
For my supp to finally picking supp that work
necas19388
 
Automated Test Case Repair Using Language Models
Lionel Briand
 
EO4EU Ocean Monitoring: Maritime Weather Routing Optimsation Use Case
EO4EU
 
Continouous failure - Why do we make our lives hard?
Papp Krisztián
 
The Rise of Sustainable Mobile App Solutions by New York Development Firms
ostechnologies16
 
IObit Uninstaller Pro 14.3.1.8 Crack for Windows Latest
utfefguu
 
capitulando la keynote de GrafanaCON 2025 - Madrid
Imma Valls Bernaus
 
Seamless-Image-Conversion-From-Raster-to-wrt-rtx-rtx.pptx
Quick Conversion Services
 
CONCEPT OF PROGRAMMING in language .pptx
tamim41
 
Automatic_Iperf_Log_Result_Excel_visual_v2.pptx
Chen-Chih Lee
 
NeuroStrata: Harnessing Neuro-Symbolic Paradigms for Improved Testability and...
Ivan Ruchkin
 
Laboratory Workflows Digitalized and live in 90 days with Scifeon´s SAPPA P...
info969686
 
From Chaos to Clarity: Mastering Analytics Governance in the Modern Enterprise
Wiiisdom
 
computer forensics encase emager app exp6 1.pptx
ssuser343e92
 
AWS Consulting Services: Empowering Digital Transformation with Nlineaxis
Nlineaxis IT Solutions Pvt Ltd
 
Difference Between Kubernetes and Docker .pdf
Kindlebit Solutions
 
IDM Crack with Internet Download Manager 6.42 [Latest 2025]
HyperPc soft
 
Code Once; Run Everywhere - A Beginner’s Journey with React Native
Hasitha Walpola
 
Ad

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.