SlideShare a Scribd company logo
INTRODUCTION
TO REACT
Jamal O’Garro
Software Engineer
CODE CREW | DECEMBER 30, 2017
• Full-stack web-developer based in NYC
• Professional Languages: JavaScript, Node,
React, D3, TypeScript, Python
• Hobby languages: Haskell, Swift, Objective-
C, Golang
• Mostly self-taught
• Native New Yorker
• Sneakerhead + Hip Hop Head
• True Knicks fan
CODE CREW | DECEMBER 30, 2017
BIO
• High-level overview of React (the basics)
• React ecosystem
• Look at the create-react-app project
• Discuss structuring a small React application
• Component life cycle
• Eventing system
• Look at some code
• Resources
TODAY’S AGENDA
CODE CREW | DECEMBER 30, 2017
• Comfortable with JavaScript
• Familiar with ES6/ES7/ES8 syntax
• Somewhat familiar with Babel and Webpack
• Know what the DOM is
ASSUMPTIONS
CODE CREW | DECEMBER 30, 2017
REACT
CODE CREW | DECEMBER 30, 2017
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 (React Native)
CODE CREW | DECEMBER 30, 2017
WHO IS USING REACT?
CODE CREW | DECEMBER 30, 2017
THE REACT ECOSYSTEM
CODE CREW | DECEMBER 30, 2017
CREATE REACT APP
• Takes the hassle out of setting up a new React project
• Provides react-scripts to run tests, create prod and dev build, etc.
• Sets up Webpack and Babel configurations
• Provides hot reloading and code splitting
• Dev server for free!
• Everything is FREE!!!!
CODE CREW | DECEMBER 30, 2017
VIRTUAL DOM
• JavaScript representation of the DOM tree
• Provides better performance for DOM updates
• Uses a very performant internal diff’ing algorithm to
determine which elements are updated
• When the state or props of a component changes the
virtual DOM is re-rendered to reflect the changes
CODE CREW | DECEMBER 30, 2017
JSX
• Preprocessor step that adds XML syntax to JavaScript
• Representation of your virtual DOM
• Looks kind of like HTML in your JavaScript but it’s not…
• Actually gets compiled by Babel and Webpack
CODE CREW | DECEMBER 30, 2017
EXAMPLE JSX
CODE CREW | DECEMBER 30, 2017
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
CODE CREW | DECEMBER 30, 2017
EXAMPLE COMPONENT
CODE CREW | DECEMBER 30, 2017
CONTAINER VS. PRESENTATION COMPONENTS
Container
• Holds the state
• Passes state down to child components
• Passes functions down to child components
Presentational
• Does not have an internal state
• Receives data and actions (functions) via props
• Re-renders when its props change
CODE CREW | DECEMBER 30, 2017
STATE
CODE CREW | DECEMBER 30, 2017
PROPS
CODE CREW | DECEMBER 30, 2017
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 - write logic to control when a re-render should occur
• componentDidUpdate - called after the component has been updated
CODE CREW | DECEMBER 30, 2017
EVENTS
• Are synthetic (wrapped by React for performance reasons)
• Can still reference the native DOM event object if we want to
• Are passed a reference to a JavaScript function to call when
triggered (not a string like in the actual DOM)
• Events are camel cased on the React element they are bound to
CODE CREW | DECEMBER 30, 2017
EVENT EXAMPLE
CODE CREW | DECEMBER 30, 2017
LET’S LOOK AT SOME CODE!
CODE CREW | DECEMBER 30, 2017
RESOURCES
CODE CREW | DECEMBER 30, 2017
USEFUL TOOLS AND LIBRARIES
• react
• react-redux
• reselect
• react-router
• redux-saga
• redux-thunk
• redux-form
CODE CREW | DECEMBER 30, 2017
• axios
• Request
• isomorphic-fetch
• ESLint
• Jest
• Yarn
• material-ui
• Semantic UI
TOPICS WE DIDN’T COVER
• References
• Higher-order components
• Prop types
• Context
• Controlled vs. uncontrolled components
• Server-side rendering/isomorphic (universal) applications
• Redux, Flux, MobX, GraphQL
• React Native
CODE CREW | DECEMBER 30, 2017
CODE CREW | DECEMBER 30, 2017
THANK YOU!!!
Jamal O’Garro
Software Engineer + Instructor
CODE CREW | DECEMBER 30, 2017

More Related Content

What's hot (20)

PDF
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Christian Posta
 
PDF
Serverless brewbox
Lino Telera
 
PDF
Introduce flux & react in practice
Hsuan Fu Lien
 
PPTX
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
Frank van der Linden
 
PDF
Spring Tooling: What's new and what's coming
martinlippert
 
PPTX
Alfresco DevCon 2019: Interaxo - A journey to Cloud Native
Asgeir Frimannsson
 
PPTX
Serverless Summit India 2017: Fission
Vishal Biyani
 
PDF
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Fwdays
 
PPTX
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Waldek Mastykarz
 
PPTX
Spangulumbraco
Filip Bruun Bech-Larsen
 
PDF
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
Mauricio (Salaboy) Salatino
 
PDF
Stripe con 2021 UI stack
MaximeRainville1
 
PPTX
Building a Web Frontend with Microservices and NGINX Plus
NGINX, Inc.
 
PDF
Deploy your machine learning models to production with Kubernetes
cnvrg.io AI OS - Hands-on ML Workshops
 
PPTX
React native - React(ive) Way To Build Native Mobile Apps
Jimit Shah
 
PPTX
AWS Serverless solution for developers
Michael Haberman
 
PDF
Knative And Pivotal Function As a Service
Jay Lee
 
PDF
Knative and Riff
Jay Lee
 
PDF
Building Resilient Cloud Native Apps in GKE
Jerry Jalava
 
PDF
Ohio Devfest - Visual Analysis with GCP
Wesley Workman
 
Microservices with Spring Cloud, Netflix OSS and Kubernetes
Christian Posta
 
Serverless brewbox
Lino Telera
 
Introduce flux & react in practice
Hsuan Fu Lien
 
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
Frank van der Linden
 
Spring Tooling: What's new and what's coming
martinlippert
 
Alfresco DevCon 2019: Interaxo - A journey to Cloud Native
Asgeir Frimannsson
 
Serverless Summit India 2017: Fission
Vishal Biyani
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Fwdays
 
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Waldek Mastykarz
 
Spangulumbraco
Filip Bruun Bech-Larsen
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
Mauricio (Salaboy) Salatino
 
Stripe con 2021 UI stack
MaximeRainville1
 
Building a Web Frontend with Microservices and NGINX Plus
NGINX, Inc.
 
Deploy your machine learning models to production with Kubernetes
cnvrg.io AI OS - Hands-on ML Workshops
 
React native - React(ive) Way To Build Native Mobile Apps
Jimit Shah
 
AWS Serverless solution for developers
Michael Haberman
 
Knative And Pivotal Function As a Service
Jay Lee
 
Knative and Riff
Jay Lee
 
Building Resilient Cloud Native Apps in GKE
Jerry Jalava
 
Ohio Devfest - Visual Analysis with GCP
Wesley Workman
 

Similar to Intro to React (20)

PPTX
Untangling - fall2017 - week 9
Derek Jacoby
 
PDF
MEAN Stack Warm-up
Troy Miles
 
PPTX
Untangling - fall2017 - week 8
Derek Jacoby
 
PPTX
Kiss.ts - The Keep It Simple Software Stack for 2017++
Ethan Ram
 
PDF
React Tech Salon
Chenguang ZHANG
 
PDF
Node.js for .NET Developers
David Neal
 
PPTX
GDG Workshop on React (By Aakanksha Rai)
gdgoncampuslncts
 
PDF
Masterin Large Scale Java Script Applications
Fabian Jakobs
 
PPTX
Super tools to boost productivity in React dev env!
Souvik Basu
 
PPTX
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
zmulani8
 
PPTX
An evening with React Native
Mike Melusky
 
PDF
Bundle your modules with Webpack
Jake Peyser
 
PDF
React && React Native workshop
Stacy Goh
 
PDF
Putting the Native in React Native - React Native NYC
stan229
 
PDF
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth
 
PPTX
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
PPTX
Nodejs overview
Nicola Del Gobbo
 
PDF
Putting the Native in React Native - React Native Boston
stan229
 
PDF
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
PPTX
React.js at Cortex
Geoff Harcourt
 
Untangling - fall2017 - week 9
Derek Jacoby
 
MEAN Stack Warm-up
Troy Miles
 
Untangling - fall2017 - week 8
Derek Jacoby
 
Kiss.ts - The Keep It Simple Software Stack for 2017++
Ethan Ram
 
React Tech Salon
Chenguang ZHANG
 
Node.js for .NET Developers
David Neal
 
GDG Workshop on React (By Aakanksha Rai)
gdgoncampuslncts
 
Masterin Large Scale Java Script Applications
Fabian Jakobs
 
Super tools to boost productivity in React dev env!
Souvik Basu
 
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
zmulani8
 
An evening with React Native
Mike Melusky
 
Bundle your modules with Webpack
Jake Peyser
 
React && React Native workshop
Stacy Goh
 
Putting the Native in React Native - React Native NYC
stan229
 
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth
 
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
Nodejs overview
Nicola Del Gobbo
 
Putting the Native in React Native - React Native Boston
stan229
 
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
React.js at Cortex
Geoff Harcourt
 
Ad

More from Jamal Sinclair O'Garro (14)

PDF
A Look at TensorFlow.js
Jamal Sinclair O'Garro
 
PDF
Intro to ionic 2
Jamal Sinclair O'Garro
 
PDF
Intro to ES6 / ES2015
Jamal Sinclair O'Garro
 
PDF
The Ten Code Commandments
Jamal Sinclair O'Garro
 
PDF
Using TypeScript with Angular
Jamal Sinclair O'Garro
 
PDF
Intro to UI-Router/TypeScript
Jamal Sinclair O'Garro
 
PDF
Intro to Node.js
Jamal Sinclair O'Garro
 
PDF
Intro to iOS Development
Jamal Sinclair O'Garro
 
PDF
Introduction to AngularJS
Jamal Sinclair O'Garro
 
PDF
Intro to rails 2_kg_edited
Jamal Sinclair O'Garro
 
PDF
Intro to Ruby on Rails
Jamal Sinclair O'Garro
 
PDF
Intro to javascript (4 week)
Jamal Sinclair O'Garro
 
PDF
Intro to HTML + CSS
Jamal Sinclair O'Garro
 
PDF
Intro to Programming
Jamal Sinclair O'Garro
 
A Look at TensorFlow.js
Jamal Sinclair O'Garro
 
Intro to ionic 2
Jamal Sinclair O'Garro
 
Intro to ES6 / ES2015
Jamal Sinclair O'Garro
 
The Ten Code Commandments
Jamal Sinclair O'Garro
 
Using TypeScript with Angular
Jamal Sinclair O'Garro
 
Intro to UI-Router/TypeScript
Jamal Sinclair O'Garro
 
Intro to Node.js
Jamal Sinclair O'Garro
 
Intro to iOS Development
Jamal Sinclair O'Garro
 
Introduction to AngularJS
Jamal Sinclair O'Garro
 
Intro to rails 2_kg_edited
Jamal Sinclair O'Garro
 
Intro to Ruby on Rails
Jamal Sinclair O'Garro
 
Intro to javascript (4 week)
Jamal Sinclair O'Garro
 
Intro to HTML + CSS
Jamal Sinclair O'Garro
 
Intro to Programming
Jamal Sinclair O'Garro
 
Ad

Recently uploaded (20)

PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 

Intro to React

  • 1. INTRODUCTION TO REACT Jamal O’Garro Software Engineer CODE CREW | DECEMBER 30, 2017
  • 2. • Full-stack web-developer based in NYC • Professional Languages: JavaScript, Node, React, D3, TypeScript, Python • Hobby languages: Haskell, Swift, Objective- C, Golang • Mostly self-taught • Native New Yorker • Sneakerhead + Hip Hop Head • True Knicks fan CODE CREW | DECEMBER 30, 2017 BIO
  • 3. • High-level overview of React (the basics) • React ecosystem • Look at the create-react-app project • Discuss structuring a small React application • Component life cycle • Eventing system • Look at some code • Resources TODAY’S AGENDA CODE CREW | DECEMBER 30, 2017
  • 4. • Comfortable with JavaScript • Familiar with ES6/ES7/ES8 syntax • Somewhat familiar with Babel and Webpack • Know what the DOM is ASSUMPTIONS CODE CREW | DECEMBER 30, 2017
  • 5. REACT CODE CREW | DECEMBER 30, 2017
  • 6. 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 (React Native) CODE CREW | DECEMBER 30, 2017
  • 7. WHO IS USING REACT? CODE CREW | DECEMBER 30, 2017
  • 8. THE REACT ECOSYSTEM CODE CREW | DECEMBER 30, 2017
  • 9. CREATE REACT APP • Takes the hassle out of setting up a new React project • Provides react-scripts to run tests, create prod and dev build, etc. • Sets up Webpack and Babel configurations • Provides hot reloading and code splitting • Dev server for free! • Everything is FREE!!!! CODE CREW | DECEMBER 30, 2017
  • 10. VIRTUAL DOM • JavaScript representation of the DOM tree • Provides better performance for DOM updates • Uses a very performant internal diff’ing algorithm to determine which elements are updated • When the state or props of a component changes the virtual DOM is re-rendered to reflect the changes CODE CREW | DECEMBER 30, 2017
  • 11. JSX • Preprocessor step that adds XML syntax to JavaScript • Representation of your virtual DOM • Looks kind of like HTML in your JavaScript but it’s not… • Actually gets compiled by Babel and Webpack CODE CREW | DECEMBER 30, 2017
  • 12. EXAMPLE JSX CODE CREW | DECEMBER 30, 2017
  • 13. 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 CODE CREW | DECEMBER 30, 2017
  • 14. EXAMPLE COMPONENT CODE CREW | DECEMBER 30, 2017
  • 15. CONTAINER VS. PRESENTATION COMPONENTS Container • Holds the state • Passes state down to child components • Passes functions down to child components Presentational • Does not have an internal state • Receives data and actions (functions) via props • Re-renders when its props change CODE CREW | DECEMBER 30, 2017
  • 16. STATE CODE CREW | DECEMBER 30, 2017
  • 17. PROPS CODE CREW | DECEMBER 30, 2017
  • 18. 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 - write logic to control when a re-render should occur • componentDidUpdate - called after the component has been updated CODE CREW | DECEMBER 30, 2017
  • 19. EVENTS • Are synthetic (wrapped by React for performance reasons) • Can still reference the native DOM event object if we want to • Are passed a reference to a JavaScript function to call when triggered (not a string like in the actual DOM) • Events are camel cased on the React element they are bound to CODE CREW | DECEMBER 30, 2017
  • 20. EVENT EXAMPLE CODE CREW | DECEMBER 30, 2017
  • 21. LET’S LOOK AT SOME CODE! CODE CREW | DECEMBER 30, 2017
  • 22. RESOURCES CODE CREW | DECEMBER 30, 2017
  • 23. USEFUL TOOLS AND LIBRARIES • react • react-redux • reselect • react-router • redux-saga • redux-thunk • redux-form CODE CREW | DECEMBER 30, 2017 • axios • Request • isomorphic-fetch • ESLint • Jest • Yarn • material-ui • Semantic UI
  • 24. TOPICS WE DIDN’T COVER • References • Higher-order components • Prop types • Context • Controlled vs. uncontrolled components • Server-side rendering/isomorphic (universal) applications • Redux, Flux, MobX, GraphQL • React Native CODE CREW | DECEMBER 30, 2017
  • 25. CODE CREW | DECEMBER 30, 2017
  • 26. THANK YOU!!! Jamal O’Garro Software Engineer + Instructor CODE CREW | DECEMBER 30, 2017