SlideShare a Scribd company logo
1 of 20
REACT 101
ABOUT JANICE
• Lead Engineer on Starfish at Hobsons
• Polyglot Developer
• Recently Lost 50 pounds.
• Email: Janice.gluck@hobsons.com
• Twitter @jumpinjanice
ABOUT REACT
• Created by Facebook
• View Only – It Renders HTML
• Components  (JSX)
• Official Documentation – Good Reference – Meh for learning
• Virtual DOM – Give it State – How to Interprete it and it does the diffing
and rendering for you.
• Builtin Performance Tools
HISTORY OF REACT (FACEBOOK)
• XSS injections and PHP (string concatenation)
• XHP - extended PHP that includes XML so no more escaping – secure
• XHP allows custom tags – so build website using composable
components –
• Moved to javascript to move away from server round-trip
• Port XHP to Javascript = React
• Updating the DOM the most difficult thing to do
• http://thenewstack.io/javascripts-history-and-how-it-led-to-reactjs
• Really Good React History Video
INSTALL REACT – NEW APPLICATION
• https://facebook.github.io/react/docs/installation.html
BUILD TOOLS
• https://github.com/facebookincubator/create-react-app
• Webpack
• Babel
• Autoprefixer
• ESLint
• Jest
GRUNT AND GULP
• Build React App Using Grunt
• Build React App Using Gulp
WINK AND LIZZIE
JSX
• Extension of JavaScript
• Use to Describe what the UI should look like
• Produces React Elements
• JSX expresses the virtual DOM
• babel.io
• https://medium.com/javascript-scene/jsx-looks-like-an-abomination-
1c1ec351a918
CODE EXAMPLES
• Simple React Component
• React Component with JSX Events
• Arrow Events - No Rerender
• Working with Other Frameworks/Libraries
STATE VS PROPS
• Props are the component’s configuration and are immutable.
• State is a representation of the component at a point in time. State is
private to the component. State can be changed.
• Stateless Components just have props and are used for rendering only
(PureComponent)
• Stateful Components manage communications, data processing, and
respond to user events. Minimize the number of these components
• State vs Props Example
TURDUCKEN
COMPOSING COMPONENTS
• Composing Components
• Components and Properties
REACT LIFE CYCLE
• https://facebook.github.io/react/docs/react-component.html
• Constructor
• componentWillMount
• Render
• componentDidMount
• shouldComponentUpdate
WINK ERROR HANDLING
ERROR HANDLING
• unstable_handleError article
• unstable_handleError Example
• Batching Strategy for Error Handling
UNIT TESTING
• Unit Testing Example
• Unit Testing with Jasmine Article
PERFORMANCE TESTING
• React Performance Testing Tools
HIGHER ORDER COMPONENTS
• Function that transforms components into other components
• Higher Order Component Example
REDUX
• Implementation of Flux
• Flux is an architectural pattern used at Facebook for the application
framework that make a full app (React is view only)
• React - Redux - LIving Room Furniture
• Redux Tutorial

More Related Content

What's hot

Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoWeng Wei
 
WordPress Development Environments
WordPress Development EnvironmentsWordPress Development Environments
WordPress Development EnvironmentsJosh Cummings
 
VeeamON 2014 Protecting Data of Small Government Organizations with Veeam
VeeamON 2014 Protecting Data of Small Government Organizations with VeeamVeeamON 2014 Protecting Data of Small Government Organizations with Veeam
VeeamON 2014 Protecting Data of Small Government Organizations with VeeamJim Jones
 
2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote2015 WordCamp Maine Keynote
2015 WordCamp Maine KeynoteScott Taylor
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptWojciech Dzikowski
 
React brief introduction
React brief introductionReact brief introduction
React brief introductionPrograils.com
 
WordPress: Getting Under the Hood
WordPress: Getting Under the HoodWordPress: Getting Under the Hood
WordPress: Getting Under the HoodScott Taylor
 
Python to go
Python to goPython to go
Python to goWeng Wei
 
Ruby Concurrency Realities
Ruby Concurrency RealitiesRuby Concurrency Realities
Ruby Concurrency RealitiesMike Subelsky
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page WebappAkshay Mathur
 
Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in ClojureTroy Miles
 
Multilingual WordPress - Problems And Solutions
Multilingual WordPress - Problems And SolutionsMultilingual WordPress - Problems And Solutions
Multilingual WordPress - Problems And SolutionsEdgar Marukyan
 
I Got 99 Problems and a Bash DSL Ain't One of Them
I Got 99 Problems and a Bash DSL Ain't One of ThemI Got 99 Problems and a Bash DSL Ain't One of Them
I Got 99 Problems and a Bash DSL Ain't One of ThemJohn Willis
 
Devops With Boxfuse and Shippable
Devops With Boxfuse and ShippableDevops With Boxfuse and Shippable
Devops With Boxfuse and ShippableAndrew Schwabe
 
Bootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeomanBootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeomanMakarand Bhatambarekar
 

What's hot (20)

ReactJS Code Impact
ReactJS Code ImpactReactJS Code Impact
ReactJS Code Impact
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
 
WordPress Development Environments
WordPress Development EnvironmentsWordPress Development Environments
WordPress Development Environments
 
VeeamON 2014 Protecting Data of Small Government Organizations with Veeam
VeeamON 2014 Protecting Data of Small Government Organizations with VeeamVeeamON 2014 Protecting Data of Small Government Organizations with Veeam
VeeamON 2014 Protecting Data of Small Government Organizations with Veeam
 
2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote
 
Working local
Working localWorking local
Working local
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
 
React brief introduction
React brief introductionReact brief introduction
React brief introduction
 
WordPress: Getting Under the Hood
WordPress: Getting Under the HoodWordPress: Getting Under the Hood
WordPress: Getting Under the Hood
 
Python to go
Python to goPython to go
Python to go
 
Ruby Concurrency Realities
Ruby Concurrency RealitiesRuby Concurrency Realities
Ruby Concurrency Realities
 
Testing Single Page Webapp
Testing Single Page WebappTesting Single Page Webapp
Testing Single Page Webapp
 
Ten years later
Ten years laterTen years later
Ten years later
 
Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in Clojure
 
Multilingual WordPress - Problems And Solutions
Multilingual WordPress - Problems And SolutionsMultilingual WordPress - Problems And Solutions
Multilingual WordPress - Problems And Solutions
 
I Got 99 Problems and a Bash DSL Ain't One of Them
I Got 99 Problems and a Bash DSL Ain't One of ThemI Got 99 Problems and a Bash DSL Ain't One of Them
I Got 99 Problems and a Bash DSL Ain't One of Them
 
Devops With Boxfuse and Shippable
Devops With Boxfuse and ShippableDevops With Boxfuse and Shippable
Devops With Boxfuse and Shippable
 
Bootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeomanBootstrapping angular js with bower grunt yeoman
Bootstrapping angular js with bower grunt yeoman
 
Azure Websites
Azure WebsitesAzure Websites
Azure Websites
 
Cucumber
CucumberCucumber
Cucumber
 

Similar to React101 v3

Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friendFilip Bruun Bech-Larsen
 
Learning React - I
Learning React - ILearning React - I
Learning React - IMitch Chen
 
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
 
Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)Hsuan Fu Lien
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Marco Breveglieri
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREnearlearn
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREnearlearn
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIMarcin Grzywaczewski
 
Building High-Performance Force.com Applications in React
Building High-Performance Force.com Applications in ReactBuilding High-Performance Force.com Applications in React
Building High-Performance Force.com Applications in ReactSalesforce Developers
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineFlorian Dutey
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Introduce flux & react in practice
Introduce flux & react in practiceIntroduce flux & react in practice
Introduce flux & react in practiceHsuan Fu Lien
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to ReactAustin Garrod
 
Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Brooklyn Zelenka
 
RichFaces CDK: Rapid JSF Component Development
RichFaces CDK: Rapid JSF Component DevelopmentRichFaces CDK: Rapid JSF Component Development
RichFaces CDK: Rapid JSF Component DevelopmentLukáš Fryč
 
Introduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingIntroduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingBlessing Ebowe
 
React + Mobile
React + MobileReact + Mobile
React + Mobileantriss
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobXDarko Kukovec
 

Similar to React101 v3 (20)

Webcomponents are your frameworks best friend
Webcomponents are your frameworks best friendWebcomponents are your frameworks best friend
Webcomponents are your frameworks best friend
 
Learning React - I
Learning React - ILearning React - I
Learning React - I
 
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
 
Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)Introduce Flux & react in practices (KKBOX)
Introduce Flux & react in practices (KKBOX)
 
Meteor + React
Meteor + ReactMeteor + React
Meteor + React
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALORE
 
React js TRAINING IN BANGALORE
React js TRAINING IN BANGALOREReact js TRAINING IN BANGALORE
React js TRAINING IN BANGALORE
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
Building High-Performance Force.com Applications in React
Building High-Performance Force.com Applications in ReactBuilding High-Performance Force.com Applications in React
Building High-Performance Force.com Applications in React
 
RubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipelineRubyConf China 2015 - Rails off assets pipeline
RubyConf China 2015 - Rails off assets pipeline
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Introduce flux & react in practice
Introduce flux & react in practiceIntroduce flux & react in practice
Introduce flux & react in practice
 
Introduction to React
Introduction to ReactIntroduction to React
Introduction to React
 
Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)Relay: Seamless Syncing for React (VanJS)
Relay: Seamless Syncing for React (VanJS)
 
RichFaces CDK: Rapid JSF Component Development
RichFaces CDK: Rapid JSF Component DevelopmentRichFaces CDK: Rapid JSF Component Development
RichFaces CDK: Rapid JSF Component Development
 
Introduction to React by Ebowe Blessing
Introduction to React by Ebowe BlessingIntroduction to React by Ebowe Blessing
Introduction to React by Ebowe Blessing
 
React + Mobile
React + MobileReact + Mobile
React + Mobile
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobX
 

Recently uploaded

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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
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
 

Recently uploaded (20)

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
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 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
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
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
 
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
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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...
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
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
 

React101 v3

  • 2. ABOUT JANICE • Lead Engineer on Starfish at Hobsons • Polyglot Developer • Recently Lost 50 pounds. • Email: Janice.gluck@hobsons.com • Twitter @jumpinjanice
  • 3. ABOUT REACT • Created by Facebook • View Only – It Renders HTML • Components  (JSX) • Official Documentation – Good Reference – Meh for learning • Virtual DOM – Give it State – How to Interprete it and it does the diffing and rendering for you. • Builtin Performance Tools
  • 4. HISTORY OF REACT (FACEBOOK) • XSS injections and PHP (string concatenation) • XHP - extended PHP that includes XML so no more escaping – secure • XHP allows custom tags – so build website using composable components – • Moved to javascript to move away from server round-trip • Port XHP to Javascript = React • Updating the DOM the most difficult thing to do • http://thenewstack.io/javascripts-history-and-how-it-led-to-reactjs • Really Good React History Video
  • 5. INSTALL REACT – NEW APPLICATION • https://facebook.github.io/react/docs/installation.html
  • 6. BUILD TOOLS • https://github.com/facebookincubator/create-react-app • Webpack • Babel • Autoprefixer • ESLint • Jest
  • 7. GRUNT AND GULP • Build React App Using Grunt • Build React App Using Gulp
  • 9. JSX • Extension of JavaScript • Use to Describe what the UI should look like • Produces React Elements • JSX expresses the virtual DOM • babel.io • https://medium.com/javascript-scene/jsx-looks-like-an-abomination- 1c1ec351a918
  • 10. CODE EXAMPLES • Simple React Component • React Component with JSX Events • Arrow Events - No Rerender • Working with Other Frameworks/Libraries
  • 11. STATE VS PROPS • Props are the component’s configuration and are immutable. • State is a representation of the component at a point in time. State is private to the component. State can be changed. • Stateless Components just have props and are used for rendering only (PureComponent) • Stateful Components manage communications, data processing, and respond to user events. Minimize the number of these components • State vs Props Example
  • 13. COMPOSING COMPONENTS • Composing Components • Components and Properties
  • 14. REACT LIFE CYCLE • https://facebook.github.io/react/docs/react-component.html • Constructor • componentWillMount • Render • componentDidMount • shouldComponentUpdate
  • 16. ERROR HANDLING • unstable_handleError article • unstable_handleError Example • Batching Strategy for Error Handling
  • 17. UNIT TESTING • Unit Testing Example • Unit Testing with Jasmine Article
  • 18. PERFORMANCE TESTING • React Performance Testing Tools
  • 19. HIGHER ORDER COMPONENTS • Function that transforms components into other components • Higher Order Component Example
  • 20. REDUX • Implementation of Flux • Flux is an architectural pattern used at Facebook for the application framework that make a full app (React is view only) • React - Redux - LIving Room Furniture • Redux Tutorial

Editor's Notes

  1. https://thenewstack.io/javascripts-history-and-how-it-led-to-reactjs/ Costly part of a javascript app is to render your data – react takes care of this by having a virtual dom in memory and doing a very fast diff In essence, the ReactJS interface is different than other js libraries which are more imperative, meaning you tell them to change the DOM directly. Jquery is like this. ReactJS is more like: here is my state, and here is how you should interpret my state and how it will change. Now, I can sit back and let ReactJS handle the expensive and complicated task of making this visible to the user in the browser. https://facebook.github.io/react/docs/perf.html
  2. XSS = Cross Site Scripting Asa - add Virtual DOM diagram pleasant french accent - speaker
  3. Switch out to react-101 app and show started app and README.md (IN ATOM) and file structure
  4. Webpack – module bundler – dependency graph for every module needed – bundles everything up for you – sort of like maven but much better? – build tool very flexible and powerful Babel – javascript transpiler – lets you use new javascript features ”now” without having to wait for all browsers to support them by translating to older javascript Autoprefixer - allows new features of CSS to be introduced into different browsers in different ways and not at the same time ESLint – static code analysis – like Sonar Jest – javascript testing tool from face book ADD gulp or grunt links that do similar things
  5. React Elements are descriptions of what you want to see on the screen. On babeljs.io – show class instead of className, show dash (used as a minus sign) and show an arrow function
  6. JSX Events – can use arrow functions instead of binding this – arrrow functions don’t have their own this scope – their “this” is the enclosing execution context - easier than “this” and binding BUT each time you click the button a rerender will trigger because arrow function syntax creates a “new anonymous function each time) Working with other libraries – can also put them in componentDidMount() – (react life cycle method)
  7. Both are JS Objects, trigger a render update and are deterministic - generates the same output each time the same set of state and property values are passed iin
  8. Turducken is a dish consisting of a deboned chicken stuffed into a deboned duck, further stuffed into a deboned turkey
  9. Constructor – initialize state, bind methods componentWillMount (called just before render – setting state here won’t cause a re-render) Render (draws the component – batching up set state changes – prevents DOM thrashing ComponentDidMount - good place to load data shouldComponentUpdate – performance tweaks – tell React to skip rendering component based on state change if not needed
  10. Pattern