SlideShare a Scribd company logo
REDUX
BY DAN JIPA, TEAM LEADER SOFTVISION
a predictable state container for JavaScript apps
The need
Managing state in big applications is too complicated.
REDUX By Dan Jipa [dan.jipa@gmail.com]
There is no separation of concerns.
Simplified debugging.
! Single Source of Truth
Traditional communication between components
By Dan Jipa [dan.jipa@gmail.com]REDUX
1. Props
2. Callback functions
3. Event bubbling
4. Parent component
5. Observer pattern (publish,subscribe)
6. Global vars
1 2, 3 4 5, 6, 7
7. Context
Image: http://andrewhfarmer.com/component-communication/
Traditional data fetching
By Dan Jipa [dan.jipa@gmail.com]REDUX
1. Root component
2. Container component
By Dan Jipa [dan.jipa@gmail.com]
What do we need to start using Redux with React?
REDUX
Webpack (optional)
Babel (optional)
Redux
React - Redux
Middleware (Redux Thunk)
Request library (Fetch, Axios etc)
By Dan Jipa [dan.jipa@gmail.com]
Redux in a few words
REDUX
Store = {global application state}; dispatch()
Actions <User, Browser, Server> = the only way to change state
Reducers = mapping actions in state updates
connect() = sending data to low level components via props
high level/container components = components with access to global store
By Dan Jipa [dan.jipa@gmail.com]
Updating our state
REDUX
CURRENT STATE
Action
REDUCER NEW STATE
By Dan Jipa [dan.jipa@gmail.com]
Fetching data with Redux
REDUX
import { createStore, applyMiddleware } from 'redux'

import thunk from 'redux-thunk';

import rootReducer from '../reducers'
export default function configureStore(initialState) {

const store = createStore(rootReducer, initialState, applyMiddleware(thunk)

);

return store

}
Creating our initial store
Modifying it using actions
export function translate(text, target) {

return dispatch => {

return fetch('https://www.googleapis.com/language/translate/v2?key='+API_KEY+'&source=en&target='+target+'&q='+ text) 

.then(response => response.json())

.then(response => dispatch(receiveTranslation(text, target, response.data.translations[0].translatedText)))

}

}
By Dan Jipa [dan.jipa@gmail.com]
LEARN REDUX
REDUX
How to manage request state with React & Redux
Redux - official docs
A cartoon intro to Redux
Getting started with Redux - Video lectures by Dan Abramov
React - Redux - Udemy course (PAID)
By Dan Jipa [dan.jipa@gmail.com]
fb: dan.jipa,
tw: danjipa,
dan.jipa@gmail.com
Thank you!
Let’s stay in touch
REDUX

More Related Content

Similar to Using Redux with React (20)

PDF
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
PDF
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
PPTX
an Introduction to Redux
Amin Ashtiani
 
PDF
Redux js
Nils Petersohn
 
PPTX
006. React - Redux framework
Binh Quan Duc
 
PPTX
downloads_introduction to redux.pptx
NavneetKumar111924
 
PDF
react redux.pdf
Knoldus Inc.
 
PPTX
Redux workshop
Imran Sayed
 
PDF
Getting started with React and Redux
Paddy Lock
 
PDF
Redux and context api with react native app introduction, use cases, implemen...
Katy Slemon
 
PDF
An Introduction to Redux
NexThoughts Technologies
 
PDF
Angular2 and Redux - up & running - Nir Kaufman - Codemotion Amsterdam 2016
Codemotion
 
PDF
React.js and Redux overview
Alex Bachuk
 
PDF
The Road To Redux
Jeffrey Sanchez
 
PDF
Redux tutorial - intro to Redux by GetLittleTech
Oleg Kosuchin (GetLittleTech)
 
PPT
The Redux Introduction in react and applications .
Lalith86
 
PPTX
Getting started with Redux js
Citrix
 
PDF
Understanding redux
David Atchley
 
PPTX
Redux
Maulik Shah
 
PDF
Why Full Stack Developers Use Redux for State Management.pdf
khushnuma khan
 
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
React Redux Interview Questions PDF By ScholarHat
Scholarhat
 
an Introduction to Redux
Amin Ashtiani
 
Redux js
Nils Petersohn
 
006. React - Redux framework
Binh Quan Duc
 
downloads_introduction to redux.pptx
NavneetKumar111924
 
react redux.pdf
Knoldus Inc.
 
Redux workshop
Imran Sayed
 
Getting started with React and Redux
Paddy Lock
 
Redux and context api with react native app introduction, use cases, implemen...
Katy Slemon
 
An Introduction to Redux
NexThoughts Technologies
 
Angular2 and Redux - up & running - Nir Kaufman - Codemotion Amsterdam 2016
Codemotion
 
React.js and Redux overview
Alex Bachuk
 
The Road To Redux
Jeffrey Sanchez
 
Redux tutorial - intro to Redux by GetLittleTech
Oleg Kosuchin (GetLittleTech)
 
The Redux Introduction in react and applications .
Lalith86
 
Getting started with Redux js
Citrix
 
Understanding redux
David Atchley
 
Why Full Stack Developers Use Redux for State Management.pdf
khushnuma khan
 

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Ad

Using Redux with React

  • 1. REDUX BY DAN JIPA, TEAM LEADER SOFTVISION a predictable state container for JavaScript apps
  • 2. The need Managing state in big applications is too complicated. REDUX By Dan Jipa [[email protected]] There is no separation of concerns. Simplified debugging. ! Single Source of Truth
  • 3. Traditional communication between components By Dan Jipa [[email protected]]REDUX 1. Props 2. Callback functions 3. Event bubbling 4. Parent component 5. Observer pattern (publish,subscribe) 6. Global vars 1 2, 3 4 5, 6, 7 7. Context Image: http://andrewhfarmer.com/component-communication/
  • 4. Traditional data fetching By Dan Jipa [[email protected]]REDUX 1. Root component 2. Container component
  • 5. By Dan Jipa [[email protected]] What do we need to start using Redux with React? REDUX Webpack (optional) Babel (optional) Redux React - Redux Middleware (Redux Thunk) Request library (Fetch, Axios etc)
  • 6. By Dan Jipa [[email protected]] Redux in a few words REDUX Store = {global application state}; dispatch() Actions <User, Browser, Server> = the only way to change state Reducers = mapping actions in state updates connect() = sending data to low level components via props high level/container components = components with access to global store
  • 7. By Dan Jipa [[email protected]] Updating our state REDUX CURRENT STATE Action REDUCER NEW STATE
  • 8. By Dan Jipa [[email protected]] Fetching data with Redux REDUX import { createStore, applyMiddleware } from 'redux'
 import thunk from 'redux-thunk';
 import rootReducer from '../reducers' export default function configureStore(initialState) {
 const store = createStore(rootReducer, initialState, applyMiddleware(thunk)
 );
 return store
 } Creating our initial store Modifying it using actions export function translate(text, target) {
 return dispatch => {
 return fetch('https://www.googleapis.com/language/translate/v2?key='+API_KEY+'&source=en&target='+target+'&q='+ text) 
 .then(response => response.json())
 .then(response => dispatch(receiveTranslation(text, target, response.data.translations[0].translatedText)))
 }
 }
  • 9. By Dan Jipa [[email protected]] LEARN REDUX REDUX How to manage request state with React & Redux Redux - official docs A cartoon intro to Redux Getting started with Redux - Video lectures by Dan Abramov React - Redux - Udemy course (PAID)
  • 10. By Dan Jipa [[email protected]] fb: dan.jipa, tw: danjipa, [email protected] Thank you! Let’s stay in touch REDUX