SlideShare a Scribd company logo
1 of 26
Download to read offline
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

Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Christian Posta
 
Serverless brewbox
Serverless   brewboxServerless   brewbox
Serverless brewboxLino Telera
 
Introduce flux & react in practice
Introduce flux & react in practiceIntroduce flux & react in practice
Introduce flux & react in practiceHsuan Fu Lien
 
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
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
Spring Tooling: What's new and what's comingSpring Tooling: What's new and what's coming
Spring Tooling: What's new and what's comingmartinlippert
 
Alfresco DevCon 2019: Interaxo - A journey to Cloud Native
Alfresco DevCon 2019: Interaxo - A journey to Cloud NativeAlfresco DevCon 2019: Interaxo - A journey to Cloud Native
Alfresco DevCon 2019: Interaxo - A journey to Cloud NativeAsgeir Frimannsson
 
Serverless Summit India 2017: Fission
Serverless Summit India 2017: FissionServerless Summit India 2017: Fission
Serverless Summit India 2017: FissionVishal Biyani
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Fwdays
 
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016Waldek Mastykarz
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> KubernetesJJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> KubernetesMauricio (Salaboy) Salatino
 
Building a Web Frontend with Microservices and NGINX Plus
Building a Web Frontend with Microservices and NGINX PlusBuilding a Web Frontend with Microservices and NGINX Plus
Building a Web Frontend with Microservices and NGINX PlusNGINX, Inc.
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsJimit Shah
 
AWS Serverless solution for developers
AWS Serverless solution for developersAWS Serverless solution for developers
AWS Serverless solution for developersMichael Haberman
 
Knative And Pivotal Function As a Service
Knative And Pivotal Function As a ServiceKnative And Pivotal Function As a Service
Knative And Pivotal Function As a ServiceJay Lee
 
Knative and Riff
Knative and RiffKnative and Riff
Knative and RiffJay Lee
 
Building Resilient Cloud Native Apps in GKE
Building Resilient Cloud Native Apps in GKEBuilding Resilient Cloud Native Apps in GKE
Building Resilient Cloud Native Apps in GKEJerry Jalava
 
Ohio Devfest - Visual Analysis with GCP
Ohio Devfest - Visual Analysis with GCPOhio Devfest - Visual Analysis with GCP
Ohio Devfest - Visual Analysis with GCPWesley Workman
 

What's hot (20)

Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes Microservices with Spring Cloud, Netflix OSS and Kubernetes
Microservices with Spring Cloud, Netflix OSS and Kubernetes
 
Serverless brewbox
Serverless   brewboxServerless   brewbox
Serverless brewbox
 
Introduce flux & react in practice
Introduce flux & react in practiceIntroduce flux & react in practice
Introduce flux & react in practice
 
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
DEV-1129 How Watson, Bluemix, Cloudant, and XPages Can Work Together In A Rea...
 
Spring Tooling: What's new and what's coming
Spring Tooling: What's new and what's comingSpring Tooling: What's new and what's coming
Spring Tooling: What's new and what's coming
 
Alfresco DevCon 2019: Interaxo - A journey to Cloud Native
Alfresco DevCon 2019: Interaxo - A journey to Cloud NativeAlfresco DevCon 2019: Interaxo - A journey to Cloud Native
Alfresco DevCon 2019: Interaxo - A journey to Cloud Native
 
Serverless Summit India 2017: Fission
Serverless Summit India 2017: FissionServerless Summit India 2017: Fission
Serverless Summit India 2017: Fission
 
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
Michael North "Ember.js 2 - Future-friendly ambitious apps, that scale!"
 
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
 
Spangulumbraco
SpangulumbracoSpangulumbraco
Spangulumbraco
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> KubernetesJJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
 
Stripe con 2021 UI stack
Stripe con 2021 UI stackStripe con 2021 UI stack
Stripe con 2021 UI stack
 
Building a Web Frontend with Microservices and NGINX Plus
Building a Web Frontend with Microservices and NGINX PlusBuilding a Web Frontend with Microservices and NGINX Plus
Building a Web Frontend with Microservices and NGINX Plus
 
Deploy your machine learning models to production with Kubernetes
Deploy your machine learning models to production with KubernetesDeploy your machine learning models to production with Kubernetes
Deploy your machine learning models to production with Kubernetes
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile Apps
 
AWS Serverless solution for developers
AWS Serverless solution for developersAWS Serverless solution for developers
AWS Serverless solution for developers
 
Knative And Pivotal Function As a Service
Knative And Pivotal Function As a ServiceKnative And Pivotal Function As a Service
Knative And Pivotal Function As a Service
 
Knative and Riff
Knative and RiffKnative and Riff
Knative and Riff
 
Building Resilient Cloud Native Apps in GKE
Building Resilient Cloud Native Apps in GKEBuilding Resilient Cloud Native Apps in GKE
Building Resilient Cloud Native Apps in GKE
 
Ohio Devfest - Visual Analysis with GCP
Ohio Devfest - Visual Analysis with GCPOhio Devfest - Visual Analysis with GCP
Ohio Devfest - Visual Analysis with GCP
 

Similar to Introduction to React Basics

Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Derek Jacoby
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-upTroy Miles
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Derek Jacoby
 
Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Ethan Ram
 
Node.js for .NET Developers
Node.js for .NET DevelopersNode.js for .NET Developers
Node.js for .NET DevelopersDavid Neal
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsFabian Jakobs
 
Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Souvik Basu
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React NativeMike Melusky
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with WebpackJake Peyser
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshopStacy Goh
 
Putting the Native in React Native - React Native NYC
Putting the Native in React Native - React Native NYCPutting the Native in React Native - React Native NYC
Putting the Native in React Native - React Native NYCstan229
 
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdfWessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdfWessel Loth
 
Putting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native BostonPutting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native Bostonstan229
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison500Tech
 
Kubernetes for Docker Users
Kubernetes for Docker UsersKubernetes for Docker Users
Kubernetes for Docker UsersWilliam Jimenez
 
MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?DrupalCamp Kyiv
 
OSH01 - Developing SharePoint Framework Solutions for the Enterprise
OSH01 - Developing SharePoint Framework Solutions for the EnterpriseOSH01 - Developing SharePoint Framework Solutions for the Enterprise
OSH01 - Developing SharePoint Framework Solutions for the EnterpriseEric Shupps
 

Similar to Introduction to React Basics (20)

Untangling - fall2017 - week 9
Untangling - fall2017 - week 9Untangling - fall2017 - week 9
Untangling - fall2017 - week 9
 
MEAN Stack Warm-up
MEAN Stack Warm-upMEAN Stack Warm-up
MEAN Stack Warm-up
 
Untangling - fall2017 - week 8
Untangling - fall2017 - week 8Untangling - fall2017 - week 8
Untangling - fall2017 - week 8
 
Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++Kiss.ts - The Keep It Simple Software Stack for 2017++
Kiss.ts - The Keep It Simple Software Stack for 2017++
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Node.js for .NET Developers
Node.js for .NET DevelopersNode.js for .NET Developers
Node.js for .NET Developers
 
Masterin Large Scale Java Script Applications
Masterin Large Scale Java Script ApplicationsMasterin Large Scale Java Script Applications
Masterin Large Scale Java Script Applications
 
Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
Bundle your modules with Webpack
Bundle your modules with WebpackBundle your modules with Webpack
Bundle your modules with Webpack
 
React && React Native workshop
React && React Native workshopReact && React Native workshop
React && React Native workshop
 
Putting the Native in React Native - React Native NYC
Putting the Native in React Native - React Native NYCPutting the Native in React Native - React Native NYC
Putting the Native in React Native - React Native NYC
 
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdfWessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
Wessel Loth - Fire your Frontend Framework with Lit - TEQnation 2022.pdf
 
Nodejs overview
Nodejs overviewNodejs overview
Nodejs overview
 
Putting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native BostonPutting the Native in React Native - React Native Boston
Putting the Native in React Native - React Native Boston
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Kubernetes for Docker Users
Kubernetes for Docker UsersKubernetes for Docker Users
Kubernetes for Docker Users
 
MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?MIGRATION - PAIN OR GAIN?
MIGRATION - PAIN OR GAIN?
 
OSH01 - Developing SharePoint Framework Solutions for the Enterprise
OSH01 - Developing SharePoint Framework Solutions for the EnterpriseOSH01 - Developing SharePoint Framework Solutions for the Enterprise
OSH01 - Developing SharePoint Framework Solutions for the Enterprise
 

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 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
 
Intro to Programming
Intro to ProgrammingIntro to Programming
Intro to Programming
 

Recently uploaded

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
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
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 

Recently uploaded (20)

What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
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
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
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
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
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?
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 

Introduction to React Basics

  • 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