SlideShare a Scribd company logo
1 of 28
INTRODUCTION
TO REACT + REDUX
for web developers
Jamal O’Garro
Software Engineer
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
• High-level overview of React
• High-level overview of Redux
• A look at a simple application built using React + Redux
• Share my thoughts on how I like working with React
AGENDA
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
REACT
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
WHAT IS REACT?
• A JavaScript library for building user interfaces
• Developed by Facebook
• Component based
• Uses a virtual representation of the DOM for efficient updates
• Provides a functional approach to building UIs
• Learn once write everywhere principle
• Can render to the DOM or native devices
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
WHO IS USING REACT?
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
THE REACT ECOSYSTEM
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
COMPONENTS
• Functions that take some input data and returns a UI
element to display
• Implements a render method
• Optionally uses JSX to render the markup
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
EXAMPLE COMPONENT
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
CONTAINER VS. PRESENTATION COMPONENTS
Container
• Controls the state
• Knows about Redux
• Does not contain JSX
• Pass state down to child components
Presentational
• Stateless
• Does not know about Redux
• Receive data and actions via props
• Contains JSX to declare our markup
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
STATE
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
PROPS
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
COMPONENT LIFECYCLE
• Mounting - component is added to the DOM
• Unmounting - component is removed from the DOM
• componentWillMount - is called right before the component is mounted
• componentDidMount - called right after the component is mounted
• componentWillUnmount - called right before the component is unmounted
• componentWillReceiveProps - called when new props become available to the
component
• shouldComponentUpdate - allows us to write logic when a re-render should occur
• componentDidUpdate - called after the component has been updated
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
REACT ROUTER
• Routing library for React
• Keeps application’s UI in sync with the URL to allow for navigation
• Provides lazy loading, route matching, transitioning etc.
• Allows for nested routing
• Has the concept of route parameters
• Supports query string params and redirects
• Contains modules for browser history, links, hash-based URLs, etc.
• Can be tied into Redux state
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
REDUX
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
WHAT IS REDUX?
• Functional representation of the Flux design pattern
• Provides a state tree to represent your applications’ state
• State is represented by a JavaScript object
• State is immutable
• There is a single source of truth
• Any changes are made with pure functions
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
REDUX FLOW
• Something happens that will change the state
• An action is dispatched by a component that is aware of Redux
• Action passes through middleware (if necessary) and is passed off to
reducers
• Reducers calculate the new pieces of the state they own
• The root reducer calculates and returns the new state to the store
• Container component receives the new state and re-renders the child
components that require an update
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
ACTIONS
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
ACTION CREATORS
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
REDUCERS
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
STORE
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
MIDDLEWARE
• Allow us to handle side effects in our application
• Intercepts an action to modify or retrieve some data before hitting the
reducers
• Good place to handle asynchronous operations (server updates, data
fetches, etc.)
• Types of middleware
• redux-promise
• redux-thunk
• redux-saga
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
LET’S LOOK AT SOME CODE!
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
PERSONAL THOUGHTS ON REACT
• Less to learn when compared to a framework like Angular or Ember
• Hard to grasp at first but makes sense after building something
• Excited about diving into React Native (learn once apply
everywhere)
• Huge fan of the functional approach to building UIs
• Using Redux may be overkill for a simple application
• Will continue to use at work and for personal projects
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
MEANSTACK NYC MEETUP | FEBRUARY 26, 2017
RESOURCES
USEFUL TOOLS AND LIBRARIES
• react
• react-redux
• normalizr
• react-router
• redux-saga
• redux-form
• material-ui
• axios
• ESLint
• Jest
• Redux Dev Tools
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
GENERATORS + STARTER KITS
• create-react-app
• react-boilerplate
• react-starter-kit
• react-redux-starter-kit
• react-slingshot
• react-redux-saga-boilerplate
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
TOPICS WE DIDN’T COVER
• Refs
• Virtual DOM
• Eventing
• Stateless functional components
• Higher-order components
• Prop types
• React Native
• Context
• Server-side rendering
• Redux actions
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
THANK YOU!!!
Jamal O’Garro
Software Engineer
MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX

More Related Content

What's hot (20)

React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
React js - The Core Concepts
React js - The Core ConceptsReact js - The Core Concepts
React js - The Core Concepts
 
Introduction to React JS for beginners
Introduction to React JS for beginners Introduction to React JS for beginners
Introduction to React JS for beginners
 
TypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the painTypeScript: coding JavaScript without the pain
TypeScript: coding JavaScript without the pain
 
React JS
React JSReact JS
React JS
 
Webpack Introduction
Webpack IntroductionWebpack Introduction
Webpack Introduction
 
React Hooks
React HooksReact Hooks
React Hooks
 
React hooks
React hooksReact hooks
React hooks
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace ITIntroduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
 
Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
React and redux
React and reduxReact and redux
React and redux
 
Introduction to react
Introduction to reactIntroduction to react
Introduction to react
 
React workshop
React workshopReact workshop
React workshop
 
react redux.pdf
react redux.pdfreact redux.pdf
react redux.pdf
 
React Context API
React Context APIReact Context API
React Context API
 
React
React React
React
 
React js
React jsReact js
React js
 
Basics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdfBasics of React Hooks.pptx.pdf
Basics of React Hooks.pptx.pdf
 
Angular Observables & RxJS Introduction
Angular Observables & RxJS IntroductionAngular Observables & RxJS Introduction
Angular Observables & RxJS Introduction
 
Reactjs
ReactjsReactjs
Reactjs
 

Viewers also liked

React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesomeAndrew Hull
 
Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2DreamLab
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewaresBinh Quan Duc
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practicesfloydophone
 
Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...
Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...
Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...Prof. Dr. Diego Kuonen
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to ReactAustin Garrod
 
006. React - Redux framework
006. React - Redux framework006. React - Redux framework
006. React - Redux frameworkBinh Quan Duc
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Elyse Kolker Gordon
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react nativeModusJesus
 
Preserving Interactive Media - SXSW 2017
Preserving Interactive Media - SXSW 2017Preserving Interactive Media - SXSW 2017
Preserving Interactive Media - SXSW 2017Johan Oomen
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important PartsSergey Bolshchikov
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentationnishasowdri
 
React for Non Techies
React for Non TechiesReact for Non Techies
React for Non TechiesJack Hoy
 

Viewers also liked (20)

React JS and why it's awesome
React JS and why it's awesomeReact JS and why it's awesome
React JS and why it's awesome
 
React lecture
React lectureReact lecture
React lecture
 
Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2Quick start with React | DreamLab Academy #2
Quick start with React | DreamLab Academy #2
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewares
 
Rethinking Best Practices
Rethinking Best PracticesRethinking Best Practices
Rethinking Best Practices
 
Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...
Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...
Big Data, Data Science, Machine Intelligence and Learning: Demystification, T...
 
Intro to ReactJS
Intro to ReactJSIntro to ReactJS
Intro to ReactJS
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
006. React - Redux framework
006. React - Redux framework006. React - Redux framework
006. React - Redux framework
 
Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017Building Universal Web Apps with React ForwardJS 2017
Building Universal Web Apps with React ForwardJS 2017
 
Intro to react native
Intro to react nativeIntro to react native
Intro to react native
 
Medical tourism
Medical tourismMedical tourism
Medical tourism
 
Farming innovation
Farming innovationFarming innovation
Farming innovation
 
Preserving Interactive Media - SXSW 2017
Preserving Interactive Media - SXSW 2017Preserving Interactive Media - SXSW 2017
Preserving Interactive Media - SXSW 2017
 
Intro to Programming
Intro to ProgrammingIntro to Programming
Intro to Programming
 
Redux tutorial - intro to Redux by GetLittleTech
Redux tutorial - intro to Redux by GetLittleTechRedux tutorial - intro to Redux by GetLittleTech
Redux tutorial - intro to Redux by GetLittleTech
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
ReactJs presentation
ReactJs presentationReactJs presentation
ReactJs presentation
 
React js
React jsReact js
React js
 
React for Non Techies
React for Non TechiesReact for Non Techies
React for Non Techies
 

Similar to React + Redux for Web Developers

An Overview of the React Ecosystem
An Overview of the React EcosystemAn Overview of the React Ecosystem
An Overview of the React EcosystemFITC
 
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15GreeceJS
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...MskDotNet Community
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React NativeMike Melusky
 
Supercharge Your SharePoint Framework Webpart with React
Supercharge Your SharePoint Framework Webpart with ReactSupercharge Your SharePoint Framework Webpart with React
Supercharge Your SharePoint Framework Webpart with ReactEric Overfield
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
React.js for Rails Developers
React.js for Rails DevelopersReact.js for Rails Developers
React.js for Rails DevelopersArkency
 
Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Lucas Jellema
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online TrainingLearntek1
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxKulbir4
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and ReactMike Melusky
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemRami Sayar
 
Getting Started with Docker - Nick Stinemates
Getting Started with Docker - Nick StinematesGetting Started with Docker - Nick Stinemates
Getting Started with Docker - Nick StinematesAtlassian
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerWeb à Québec
 
React for .net developers
React for .net developersReact for .net developers
React for .net developersmacsdickinson
 

Similar to React + Redux for Web Developers (20)

An Overview of the React Ecosystem
An Overview of the React EcosystemAn Overview of the React Ecosystem
An Overview of the React Ecosystem
 
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
React Native and the future of web technology (Mark Wilcox) - GreeceJS #15
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
 
React introduction
React introductionReact introduction
React introduction
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
Supercharge Your SharePoint Framework Webpart with React
Supercharge Your SharePoint Framework Webpart with ReactSupercharge Your SharePoint Framework Webpart with React
Supercharge Your SharePoint Framework Webpart with React
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Render-as-You-Fetch
Render-as-You-FetchRender-as-You-Fetch
Render-as-You-Fetch
 
React.js for Rails Developers
React.js for Rails DevelopersReact.js for Rails Developers
React.js for Rails Developers
 
Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...Business and IT agility through DevOps and microservice architecture powered ...
Business and IT agility through DevOps and microservice architecture powered ...
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
React-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsxReact-Js-Online-Training-9028522.ppsx
React-Js-Online-Training-9028522.ppsx
 
Nodejs vs react js converted
Nodejs vs react js convertedNodejs vs react js converted
Nodejs vs react js converted
 
React js
React jsReact js
React js
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
An Intense Overview of the React Ecosystem
An Intense Overview of the React EcosystemAn Intense Overview of the React Ecosystem
An Intense Overview of the React Ecosystem
 
Getting Started with Docker - Nick Stinemates
Getting Started with Docker - Nick StinematesGetting Started with Docker - Nick Stinemates
Getting Started with Docker - Nick Stinemates
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
React for .net developers
React for .net developersReact for .net developers
React for .net developers
 

More from Jamal Sinclair O'Garro (14)

A Look at TensorFlow.js
A Look at TensorFlow.jsA Look at TensorFlow.js
A Look at TensorFlow.js
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Intro to ionic 2
Intro to ionic 2Intro to ionic 2
Intro to ionic 2
 
Intro to ES6 / ES2015
Intro to ES6 / ES2015Intro to ES6 / ES2015
Intro to ES6 / ES2015
 
The Ten Code Commandments
The Ten Code CommandmentsThe Ten Code Commandments
The Ten Code Commandments
 
Using TypeScript with Angular
Using TypeScript with AngularUsing TypeScript with Angular
Using TypeScript with Angular
 
Intro to UI-Router/TypeScript
Intro to UI-Router/TypeScriptIntro to UI-Router/TypeScript
Intro to UI-Router/TypeScript
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
 
Intro to iOS Development
Intro to iOS DevelopmentIntro to iOS Development
Intro to iOS Development
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Intro to rails 2_kg_edited
Intro to rails 2_kg_editedIntro to rails 2_kg_edited
Intro to rails 2_kg_edited
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
Intro to javascript (4 week)
Intro to javascript (4 week)Intro to javascript (4 week)
Intro to javascript (4 week)
 
Intro to HTML + CSS
Intro to HTML + CSSIntro to HTML + CSS
Intro to HTML + CSS
 

Recently uploaded

THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxNandakishor Bhaurao Deshmukh
 
Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx023NiWayanAnggiSriWa
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayupadhyaymani499
 
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In DubaiDubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubaikojalkojal131
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationColumbia Weather Systems
 
preservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxpreservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxnoordubaliya2003
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
Forensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptxForensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptxkumarsanjai28051
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...Universidade Federal de Sergipe - UFS
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)riyaescorts54
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfSELF-EXPLANATORY
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPirithiRaju
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.PraveenaKalaiselvan1
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRlizamodels9
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxMurugaveni B
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPirithiRaju
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》rnrncn29
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxmalonesandreagweneth
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPirithiRaju
 

Recently uploaded (20)

THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptxTHE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
THE ROLE OF PHARMACOGNOSY IN TRADITIONAL AND MODERN SYSTEM OF MEDICINE.pptx
 
Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyay
 
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In DubaiDubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather Station
 
preservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptxpreservation, maintanence and improvement of industrial organism.pptx
preservation, maintanence and improvement of industrial organism.pptx
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
Forensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptxForensic limnology of diatoms by Sanjai.pptx
Forensic limnology of diatoms by Sanjai.pptx
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
 
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
(9818099198) Call Girls In Noida Sector 14 (NOIDA ESCORTS)
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdfBehavioral Disorder: Schizophrenia & it's Case Study.pdf
Behavioral Disorder: Schizophrenia & it's Case Study.pdf
 
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdfPests of Blackgram, greengram, cowpea_Dr.UPR.pdf
Pests of Blackgram, greengram, cowpea_Dr.UPR.pdf
 
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
BIOETHICS IN RECOMBINANT DNA TECHNOLOGY.
 
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCRCall Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
Call Girls In Nihal Vihar Delhi ❤️8860477959 Looking Escorts In 24/7 Delhi NCR
 
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptxSTOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
STOPPED FLOW METHOD & APPLICATION MURUGAVENI B.pptx
 
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdfPests of safflower_Binomics_Identification_Dr.UPR.pdf
Pests of safflower_Binomics_Identification_Dr.UPR.pdf
 
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》《Queensland毕业文凭-昆士兰大学毕业证成绩单》
《Queensland毕业文凭-昆士兰大学毕业证成绩单》
 
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptxLIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
LIGHT-PHENOMENA-BY-CABUALDIONALDOPANOGANCADIENTE-CONDEZA (1).pptx
 
Pests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdfPests of Bengal gram_Identification_Dr.UPR.pdf
Pests of Bengal gram_Identification_Dr.UPR.pdf
 

React + Redux for Web Developers

  • 1. INTRODUCTION TO REACT + REDUX for web developers Jamal O’Garro Software Engineer MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 2. • High-level overview of React • High-level overview of Redux • A look at a simple application built using React + Redux • Share my thoughts on how I like working with React AGENDA MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 3. REACT MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 4. WHAT IS REACT? • A JavaScript library for building user interfaces • Developed by Facebook • Component based • Uses a virtual representation of the DOM for efficient updates • Provides a functional approach to building UIs • Learn once write everywhere principle • Can render to the DOM or native devices MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 5. WHO IS USING REACT? MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 6. THE REACT ECOSYSTEM MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 7. COMPONENTS • Functions that take some input data and returns a UI element to display • Implements a render method • Optionally uses JSX to render the markup MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 8. EXAMPLE COMPONENT MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 9. CONTAINER VS. PRESENTATION COMPONENTS Container • Controls the state • Knows about Redux • Does not contain JSX • Pass state down to child components Presentational • Stateless • Does not know about Redux • Receive data and actions via props • Contains JSX to declare our markup MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 10. STATE MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 11. PROPS MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 12. COMPONENT LIFECYCLE • Mounting - component is added to the DOM • Unmounting - component is removed from the DOM • componentWillMount - is called right before the component is mounted • componentDidMount - called right after the component is mounted • componentWillUnmount - called right before the component is unmounted • componentWillReceiveProps - called when new props become available to the component • shouldComponentUpdate - allows us to write logic when a re-render should occur • componentDidUpdate - called after the component has been updated MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 13. REACT ROUTER • Routing library for React • Keeps application’s UI in sync with the URL to allow for navigation • Provides lazy loading, route matching, transitioning etc. • Allows for nested routing • Has the concept of route parameters • Supports query string params and redirects • Contains modules for browser history, links, hash-based URLs, etc. • Can be tied into Redux state MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 14. REDUX MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 15. WHAT IS REDUX? • Functional representation of the Flux design pattern • Provides a state tree to represent your applications’ state • State is represented by a JavaScript object • State is immutable • There is a single source of truth • Any changes are made with pure functions MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 16. REDUX FLOW • Something happens that will change the state • An action is dispatched by a component that is aware of Redux • Action passes through middleware (if necessary) and is passed off to reducers • Reducers calculate the new pieces of the state they own • The root reducer calculates and returns the new state to the store • Container component receives the new state and re-renders the child components that require an update MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 17. ACTIONS MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 18. ACTION CREATORS MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 19. REDUCERS MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 20. STORE MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 21. MIDDLEWARE • Allow us to handle side effects in our application • Intercepts an action to modify or retrieve some data before hitting the reducers • Good place to handle asynchronous operations (server updates, data fetches, etc.) • Types of middleware • redux-promise • redux-thunk • redux-saga MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 22. LET’S LOOK AT SOME CODE! MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 23. PERSONAL THOUGHTS ON REACT • Less to learn when compared to a framework like Angular or Ember • Hard to grasp at first but makes sense after building something • Excited about diving into React Native (learn once apply everywhere) • Huge fan of the functional approach to building UIs • Using Redux may be overkill for a simple application • Will continue to use at work and for personal projects MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 24. MEANSTACK NYC MEETUP | FEBRUARY 26, 2017 RESOURCES
  • 25. USEFUL TOOLS AND LIBRARIES • react • react-redux • normalizr • react-router • redux-saga • redux-form • material-ui • axios • ESLint • Jest • Redux Dev Tools MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 26. GENERATORS + STARTER KITS • create-react-app • react-boilerplate • react-starter-kit • react-redux-starter-kit • react-slingshot • react-redux-saga-boilerplate MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 27. TOPICS WE DIDN’T COVER • Refs • Virtual DOM • Eventing • Stateless functional components • Higher-order components • Prop types • React Native • Context • Server-side rendering • Redux actions MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX
  • 28. THANK YOU!!! Jamal O’Garro Software Engineer MEANSTACK NYC MEETUP | INTRODUCTION TO REACT + REDUX