SlideShare a Scribd company logo
1 of 43
React / Redux Architectures
Vinícius Ribeiro {Vinna}
Software Engineer & UX Designer specialized in
Javascript, PHP, and other technologies.
Bronco Level
78%
Nice Guy Level
98%
1. Why use React?
The use of reusable, composable, and stateful components.
2. React - Design Concepts:
 The nature of reactive updates.
The virtual representation of views in memory + Tree Reconciliation.
React is a JavaScript library. It’s not a framework.
3. Why use Redux?
State is read-only: The application state cannot be mutated.
3.1. Redux - Principles:
Changes are made with pure functions: Reducers.
Single source of truth: The Redux store is the one and only source
of state in your application.
4. The search for scalability
4.1. Pattern:
Presentational and Container
Components:
Are written as as functional components.
4.1.1. Presentational Components:
Receive data and callbacks exclusively via props.
Often allow containment via props.children.
Have no dependencies on the rest of the app, such as Redux actions or stores.
Are concerned with how things look.
Are usually generated using higher order components such as
connect() from React Redux.
4.1.2. Container Components:
Are often stateful, as they tend to serve as data sources.
May contain both presentational and container components
Provide the data and behavior to presentational or other container components.
Are concerned with how things work.
4.2. Pattern:
Scaling with Ducks :
Function
vs
Feature
4.2.1. Ducks Concepts:
A duck folder: MUST keep code with similar purpose in the same
file, ex: reducers, selectors, actions, etc.
A duck folder: MUST contain the entire logic for handling only ONE
concept in your app, ex: product, cart, session, etc.
A duck folder: MUST have an index.js file that exports according to the original
duck rules.
Separate State Management files from UI files.
A duck folder: MUST contain the tests related to the duck.
store / index.js
store / ducks / index.js
store / ducks / users.js
store / ducks / thunks.js
Middlewares:
4.3. Redux Middlewares:
Redux Saga: It helps you to separate side-effects from your
application, but made it more complex because actions now used in
another part of your application where you keep your sagas.
Redux Thunk: Allows you to write action creators that return a
function instead of an action.
The thunk can be used to delay the dispatch of an action, or to
dispatch only if a certain condition is met. The inner function
receives the store methods dispatch and getState as parameters.
Questions?
Do not ask a difficult question, I'm bronco

More Related Content

What's hot

Getting started with Redux js
Getting started with Redux jsGetting started with Redux js
Getting started with Redux jsCitrix
 
React js programming concept
React js programming conceptReact js programming concept
React js programming conceptTariqul islam
 
Introduction to Facebook React
Introduction to Facebook ReactIntroduction to Facebook React
Introduction to Facebook ReactMitch Chen
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSKnoldus Inc.
 
React Context API
React Context APIReact Context API
React Context APINodeXperts
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentationThanh Tuong
 
learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .paradisetechsoftsolutions
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JSArno Lordkronos
 
React redux-tutoriel-1
React redux-tutoriel-1React redux-tutoriel-1
React redux-tutoriel-1Sem Koto
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to ReactRob Quick
 

What's hot (20)

React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
React with Redux
React with ReduxReact with Redux
React with Redux
 
Getting started with Redux js
Getting started with Redux jsGetting started with Redux js
Getting started with Redux js
 
Redux workshop
Redux workshopRedux workshop
Redux workshop
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
Introduction to Facebook React
Introduction to Facebook ReactIntroduction to Facebook React
Introduction to Facebook React
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
React Context API
React Context APIReact Context API
React Context API
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
React redux-tutoriel-1
React redux-tutoriel-1React redux-tutoriel-1
React redux-tutoriel-1
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
React js
React jsReact js
React js
 
React render props
React render propsReact render props
React render props
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
React workshop
React workshopReact workshop
React workshop
 
React js
React jsReact js
React js
 

Similar to React / Redux Architectures

an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to ReduxAmin Ashtiani
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)Chiew Carol
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorialMohammed Fazuluddin
 
A React Journey
A React JourneyA React Journey
A React JourneyLinkMe Srl
 
Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Katy Slemon
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptxSHAIKIRFAN715544
 
How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react MoonTechnolabsPvtLtd
 
React Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdfReact Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdfBOSC Tech Labs
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxSHAIKIRFAN715544
 
React in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdfReact in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdfalmako2
 
React gsg presentation with ryan jung & elias malik
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malikLama K Banna
 
React Interview Questions and Answers by Scholarhat
React Interview Questions and Answers by ScholarhatReact Interview Questions and Answers by Scholarhat
React Interview Questions and Answers by ScholarhatScholarhat
 
React Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHatReact Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHatScholarhat
 
Reactjs A javascript Library
Reactjs A javascript LibraryReactjs A javascript Library
Reactjs A javascript LibraryMohit Jain
 
ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...IRJET Journal
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdfArthyR3
 

Similar to React / Redux Architectures (20)

an Introduction to Redux
an Introduction to Reduxan Introduction to Redux
an Introduction to Redux
 
Presentation1
Presentation1Presentation1
Presentation1
 
React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)React Native +Redux + ES6 (Updated)
React Native +Redux + ES6 (Updated)
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
A React Journey
A React JourneyA React Journey
A React Journey
 
Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...Redux and context api with react native app introduction, use cases, implemen...
Redux and context api with react native app introduction, use cases, implemen...
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 
How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react How to increase the ui performance of apps designed using react
How to increase the ui performance of apps designed using react
 
React Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdfReact Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdf
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
 
React-JS.pptx
React-JS.pptxReact-JS.pptx
React-JS.pptx
 
React in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdfReact in Action ( PDFDrive ).pdf
React in Action ( PDFDrive ).pdf
 
React gsg presentation with ryan jung & elias malik
React   gsg presentation with ryan jung & elias malikReact   gsg presentation with ryan jung & elias malik
React gsg presentation with ryan jung & elias malik
 
React Interview Questions and Answers by Scholarhat
React Interview Questions and Answers by ScholarhatReact Interview Questions and Answers by Scholarhat
React Interview Questions and Answers by Scholarhat
 
React Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHatReact Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHat
 
learning react
learning reactlearning react
learning react
 
Reactjs A javascript Library
Reactjs A javascript LibraryReactjs A javascript Library
Reactjs A javascript Library
 
ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...ReactCodemod: An automated approach for refactoring class based components to...
ReactCodemod: An automated approach for refactoring class based components to...
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
 
Reactjs
ReactjsReactjs
Reactjs
 

Recently uploaded

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Recently uploaded (20)

Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

React / Redux Architectures

  • 1. React / Redux Architectures
  • 2.
  • 3. Vinícius Ribeiro {Vinna} Software Engineer & UX Designer specialized in Javascript, PHP, and other technologies. Bronco Level 78% Nice Guy Level 98%
  • 4. 1. Why use React?
  • 5.
  • 6. The use of reusable, composable, and stateful components. 2. React - Design Concepts:  The nature of reactive updates. The virtual representation of views in memory + Tree Reconciliation. React is a JavaScript library. It’s not a framework.
  • 7.
  • 8.
  • 9.
  • 10. 3. Why use Redux?
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17. State is read-only: The application state cannot be mutated. 3.1. Redux - Principles: Changes are made with pure functions: Reducers. Single source of truth: The Redux store is the one and only source of state in your application.
  • 18.
  • 19.
  • 20.
  • 21. 4. The search for scalability
  • 22.
  • 23.
  • 24. 4.1. Pattern: Presentational and Container Components:
  • 25. Are written as as functional components. 4.1.1. Presentational Components: Receive data and callbacks exclusively via props. Often allow containment via props.children. Have no dependencies on the rest of the app, such as Redux actions or stores. Are concerned with how things look.
  • 26. Are usually generated using higher order components such as connect() from React Redux. 4.1.2. Container Components: Are often stateful, as they tend to serve as data sources. May contain both presentational and container components Provide the data and behavior to presentational or other container components. Are concerned with how things work.
  • 27.
  • 28.
  • 29.
  • 31.
  • 33.
  • 34. 4.2.1. Ducks Concepts: A duck folder: MUST keep code with similar purpose in the same file, ex: reducers, selectors, actions, etc. A duck folder: MUST contain the entire logic for handling only ONE concept in your app, ex: product, cart, session, etc. A duck folder: MUST have an index.js file that exports according to the original duck rules. Separate State Management files from UI files. A duck folder: MUST contain the tests related to the duck.
  • 35.
  • 36.
  • 38. store / ducks / index.js
  • 39. store / ducks / users.js
  • 40. store / ducks / thunks.js
  • 42. 4.3. Redux Middlewares: Redux Saga: It helps you to separate side-effects from your application, but made it more complex because actions now used in another part of your application where you keep your sagas. Redux Thunk: Allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met. The inner function receives the store methods dispatch and getState as parameters.
  • 43. Questions? Do not ask a difficult question, I'm bronco