(Go: >> BACK << -|- >> HOME <<)

SlideShare a Scribd company logo
React
A JS library for building user interfaces
What we will see...
● Meet React
● Fundamentals
● Components + JSX
● Props, PropType and State
● React Lifecycle
● Demo
● Want more?
Introduction
1. Not jet another JS Framework
2. Just a library for creating User
Interfaces
3. Renders your UI and respond to
events
> ReactJS has no...
● Controllers
● Directives
● Templates
● Global Event listeners
● Models
> Just components!
First fundamental...
Everything is a COMPONENT
> Changes always flow
down via props, never
up
> Callbacks and
actions will flow up
Second fundamental...
Unidirectional Data Flow
1. React builds a new
virtual DOM subtree
2. Diffs it with the
old one
3. Computes the
minimal set of DOM
mutations and puts
them in a queue
4. Batch executes all
updates
Third fundamental…
Virtual DOM Makes re-rendering on
every change fast
Creating components
“We think that markup and the code that generates
it are intimately tied together”
React Docs
● Every component has
state and props
● Data is handled from
parent to child
● Owner-ownee VS
Parents-Children
● It acts as an
inmutable DOM and re-
render de app once
the state changes
wait...what´s {that}?...Angular?
Component example
JSX
{}
> Why should we learn
another template
language?
JSX
JSX → Javascript Syntax
Extension that looks
similar to XML
1. JSX is faster because
it performs
optimization while
compiling code to
JavaScript
2. It is also type-safe
and most of the
errors can be caught
during compilation
JSX
> Easy right?
React conversions
Props, PropTypes & State
> Used to pass parameters
from parent to childrenProps
PropTypes
> Used to catch a lot of
bug by typechecking props
> When should I use
state?
Respond to user input
Server requests
The passage of time
> Calling setState({...})
re-renders the component
State
> When should I use
state?
Respond to user input
Server requests
The passage of time
> Just use props to pass
data & event handlers
down to your child
components.
Props vs State
React Lifecycle
> componentDidMount()
Make an Ajax request to
fetch some data needed
for this component
> componentWillUnmount()
Remove any listeners you
initially set up
> componentDidMount()
Set up any listeners (ie
Websockets or Firebase
listeners)
https://staminaloops.github.io/
undefinedisnotafunction/images/
react-lifecycle.jpg
Lifecycle
> Demo has:
- Webpack (Babel &
Imports)
- React Hot Loader
- Bootstrap 3
> Steps to reproduce:
- git clone
https://github.com/B
ackSpaceTech/react-
bootstrap-
boilerplate
- npm i && npm start
DEMO TIME
What more…?
React Native
Flux
Redux
ES6 Internal Workshop
Thanks!
migueloop.github.io

More Related Content

What's hot

Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
Ritesh Mehrotra
 
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
namespaceit
 
learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .
paradisetechsoftsolutions
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
Learntek1
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Hoang Long
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop
Ahmed rebai
 
Getting Started with React-Nathan Smith
Getting Started with React-Nathan SmithGetting Started with React-Nathan Smith
Getting Started with React-Nathan Smith
TandemSeven
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
MicroPyramid .
 
React js basics
React js basicsReact js basics
React js basics
Maulik Shah
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
Alessandro Valenti
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
Tariqul islam
 
React-js
React-jsReact-js
React-js
Avi Kedar
 
React js Rahil Memon
React js Rahil MemonReact js Rahil Memon
React js Rahil Memon
RahilMemon5
 
ReactJs
ReactJsReactJs
React workshop
React workshopReact workshop
React workshop
Imran Sayed
 
Say Hello to React day2 presentation
Say Hello to React   day2 presentationSay Hello to React   day2 presentation
Say Hello to React day2 presentation
Smile Gupta
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
Sunil Yadav
 
React JS part 1
React JS part 1React JS part 1
React JS part 1
Diluka Wittahachchige
 
ReactJS
ReactJSReactJS
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with Reactjs
Thinh VoXuan
 

What's hot (20)

Its time to React.js
Its time to React.jsIts time to React.js
Its time to React.js
 
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
 
learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .learn what React JS is & why we should use React JS .
learn what React JS is & why we should use React JS .
 
React js Online Training
React js Online TrainingReact js Online Training
React js Online Training
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop
 
Getting Started with React-Nathan Smith
Getting Started with React-Nathan SmithGetting Started with React-Nathan Smith
Getting Started with React-Nathan Smith
 
Introduction to react_js
Introduction to react_jsIntroduction to react_js
Introduction to react_js
 
React js basics
React js basicsReact js basics
React js basics
 
React js for beginners
React js for beginnersReact js for beginners
React js for beginners
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
React-js
React-jsReact-js
React-js
 
React js Rahil Memon
React js Rahil MemonReact js Rahil Memon
React js Rahil Memon
 
ReactJs
ReactJsReactJs
ReactJs
 
React workshop
React workshopReact workshop
React workshop
 
Say Hello to React day2 presentation
Say Hello to React   day2 presentationSay Hello to React   day2 presentation
Say Hello to React day2 presentation
 
React Js Simplified
React Js SimplifiedReact Js Simplified
React Js Simplified
 
React JS part 1
React JS part 1React JS part 1
React JS part 1
 
ReactJS
ReactJSReactJS
ReactJS
 
Starting with Reactjs
Starting with ReactjsStarting with Reactjs
Starting with Reactjs
 

Viewers also liked

React redux workshop
React redux workshopReact redux workshop
React redux workshop
Daniel Ochoa John
 
React vs angular
React vs angularReact vs angular
React vs angular
500Tech
 
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
Binary Studio
 
Learn react-js
Learn react-jsLearn react-js
Angular 2 vs React
Angular 2 vs ReactAngular 2 vs React
Angular 2 vs React
Iran Reyes Fleitas
 
[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱
NAVER D2
 

Viewers also liked (6)

React redux workshop
React redux workshopReact redux workshop
React redux workshop
 
React vs angular
React vs angularReact vs angular
React vs angular
 
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
React vs Angular: ups & downs (speaker Oleksandr Kovalov, Binary Studio)
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Angular 2 vs React
Angular 2 vs ReactAngular 2 vs React
Angular 2 vs React
 
[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱[114]angularvs react 김훈민손찬욱
[114]angularvs react 김훈민손찬욱
 

Similar to Internal workshop react-js-mruiz

ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
George Tony
 
Introduction Web Development using ReactJS
Introduction Web Development using ReactJSIntroduction Web Development using ReactJS
Introduction Web Development using ReactJS
ssuser8a1f37
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
DivyanshGupta922023
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
StephieJohn
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
ArthyR3
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
Jeff Durta
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
SHAIKIRFAN715544
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
DayNightGaMiNg
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
Presentation1
Presentation1Presentation1
Presentation1
Kshitiz Rimal
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
DayNightGaMiNg
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
janet736113
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
GDSC UofT Mississauga
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
Tahmina Khatoon
 
React gsg presentation with ryan jung &amp; elias malik
React   gsg presentation with ryan jung &amp; elias malikReact   gsg presentation with ryan jung &amp; elias malik
React gsg presentation with ryan jung &amp; elias malik
Lama K Banna
 
Intro react js
Intro react jsIntro react js
Intro react js
Vijayakanth MP
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
Ritesh Kumar
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
Remo Jansen
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
banq jdon
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
Srikanth Shenoy
 

Similar to Internal workshop react-js-mruiz (20)

ReactJS (1)
ReactJS (1)ReactJS (1)
ReactJS (1)
 
Introduction Web Development using ReactJS
Introduction Web Development using ReactJSIntroduction Web Development using ReactJS
Introduction Web Development using ReactJS
 
ReactJS presentation.pptx
ReactJS presentation.pptxReactJS presentation.pptx
ReactJS presentation.pptx
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
REACTJS.pdf
REACTJS.pdfREACTJS.pdf
REACTJS.pdf
 
Adding a modern twist to legacy web applications
Adding a modern twist to legacy web applicationsAdding a modern twist to legacy web applications
Adding a modern twist to legacy web applications
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
 
Presentation1
Presentation1Presentation1
Presentation1
 
react-slides.pdf
react-slides.pdfreact-slides.pdf
react-slides.pdf
 
react-slides.pdf gives information about react library
react-slides.pdf gives information about react libraryreact-slides.pdf gives information about react library
react-slides.pdf gives information about react library
 
Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]Full Stack React Workshop [CSSC x GDSC]
Full Stack React Workshop [CSSC x GDSC]
 
Meet with Meteor
Meet with MeteorMeet with Meteor
Meet with Meteor
 
React gsg presentation with ryan jung &amp; elias malik
React   gsg presentation with ryan jung &amp; elias malikReact   gsg presentation with ryan jung &amp; elias malik
React gsg presentation with ryan jung &amp; elias malik
 
Intro react js
Intro react jsIntro react js
Intro react js
 
Welcome to React & Flux !
Welcome to React & Flux !Welcome to React & Flux !
Welcome to React & Flux !
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
DDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFrameworkDDD Framework for Java: JdonFramework
DDD Framework for Java: JdonFramework
 
Effective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjectsEffective JavaFX architecture with FxObjects
Effective JavaFX architecture with FxObjects
 

Recently uploaded

Non-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdf
Non-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdfNon-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdf
Non-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdf
kalichargn70th171
 
ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...
ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...
ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...
nitu gupta#N06
 
Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?
Ortus Solutions, Corp
 
Securing Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecuritySecuring Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecurity
Ortus Solutions, Corp
 
What’s New in ContentBox 6 by Ortus Solutions.pdf
What’s New in ContentBox 6 by Ortus Solutions.pdfWhat’s New in ContentBox 6 by Ortus Solutions.pdf
What’s New in ContentBox 6 by Ortus Solutions.pdf
Ortus Solutions, Corp
 
Introductory Things Related to ERP Systems.pptx
Introductory Things Related to ERP Systems.pptxIntroductory Things Related to ERP Systems.pptx
Introductory Things Related to ERP Systems.pptx
Kanhasoft
 
Disk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFSDisk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFS
Ortus Solutions, Corp
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Asher Sterkin
 
UI-UX Design - Definition and Importance of UI-UX.pptx
UI-UX Design - Definition and Importance of UI-UX.pptxUI-UX Design - Definition and Importance of UI-UX.pptx
UI-UX Design - Definition and Importance of UI-UX.pptx
Mitchell Marsh
 
Write More Durable Code: Principles and Techniques
Write More Durable Code: Principles and TechniquesWrite More Durable Code: Principles and Techniques
Write More Durable Code: Principles and Techniques
Ortus Solutions, Corp
 
YouTube SEO Mastery ......................
YouTube SEO Mastery ......................YouTube SEO Mastery ......................
YouTube SEO Mastery ......................
islamiato717
 
Intro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AIIntro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AI
Ortus Solutions, Corp
 
How to debug ColdFusion Applications using “ColdFusion Builder extension for ...
How to debug ColdFusion Applications using “ColdFusion Builder extension for ...How to debug ColdFusion Applications using “ColdFusion Builder extension for ...
How to debug ColdFusion Applications using “ColdFusion Builder extension for ...
Ortus Solutions, Corp
 
Build a Complex Web Form with RuleBox and TestBox
Build a Complex Web Form with RuleBox and TestBoxBuild a Complex Web Form with RuleBox and TestBox
Build a Complex Web Form with RuleBox and TestBox
Ortus Solutions, Corp
 
Design system: The basis for a consistent design
Design system: The basis for a consistent designDesign system: The basis for a consistent design
Design system: The basis for a consistent design
Ortus Solutions, Corp
 
cbq - Jobs and Tasks in the Background by Ortus
cbq - Jobs and Tasks in the Background by Ortuscbq - Jobs and Tasks in the Background by Ortus
cbq - Jobs and Tasks in the Background by Ortus
Ortus Solutions, Corp
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
TwisterTools
 
一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理
一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理
一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理
eydbbz
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Major Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara ConferenceMajor Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara Conference
Tier1 app
 

Recently uploaded (20)

Non-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdf
Non-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdfNon-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdf
Non-Functional Testing Guide_ Exploring Its Types, Importance and Tools.pdf
 
ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...
ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...
ℂall Girls in Surat 🔥 +91-7023059433 🔥 Best High ℂlass Surat Esℂorts Serviℂe ...
 
Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?Schrodinger’s Backup: Is Your Backup Really a Backup?
Schrodinger’s Backup: Is Your Backup Really a Backup?
 
Securing Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecuritySecuring Your Application with Passkeys and cbSecurity
Securing Your Application with Passkeys and cbSecurity
 
What’s New in ContentBox 6 by Ortus Solutions.pdf
What’s New in ContentBox 6 by Ortus Solutions.pdfWhat’s New in ContentBox 6 by Ortus Solutions.pdf
What’s New in ContentBox 6 by Ortus Solutions.pdf
 
Introductory Things Related to ERP Systems.pptx
Introductory Things Related to ERP Systems.pptxIntroductory Things Related to ERP Systems.pptx
Introductory Things Related to ERP Systems.pptx
 
Disk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFSDisk to Cloud: Abstract your File Operations with CBFS
Disk to Cloud: Abstract your File Operations with CBFS
 
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
Ported to Cloud with Wing_ Blue ZnZone app from _Hexagonal Architecture Expla...
 
UI-UX Design - Definition and Importance of UI-UX.pptx
UI-UX Design - Definition and Importance of UI-UX.pptxUI-UX Design - Definition and Importance of UI-UX.pptx
UI-UX Design - Definition and Importance of UI-UX.pptx
 
Write More Durable Code: Principles and Techniques
Write More Durable Code: Principles and TechniquesWrite More Durable Code: Principles and Techniques
Write More Durable Code: Principles and Techniques
 
YouTube SEO Mastery ......................
YouTube SEO Mastery ......................YouTube SEO Mastery ......................
YouTube SEO Mastery ......................
 
Intro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AIIntro to Amazon Web Services (AWS) and Gen AI
Intro to Amazon Web Services (AWS) and Gen AI
 
How to debug ColdFusion Applications using “ColdFusion Builder extension for ...
How to debug ColdFusion Applications using “ColdFusion Builder extension for ...How to debug ColdFusion Applications using “ColdFusion Builder extension for ...
How to debug ColdFusion Applications using “ColdFusion Builder extension for ...
 
Build a Complex Web Form with RuleBox and TestBox
Build a Complex Web Form with RuleBox and TestBoxBuild a Complex Web Form with RuleBox and TestBox
Build a Complex Web Form with RuleBox and TestBox
 
Design system: The basis for a consistent design
Design system: The basis for a consistent designDesign system: The basis for a consistent design
Design system: The basis for a consistent design
 
cbq - Jobs and Tasks in the Background by Ortus
cbq - Jobs and Tasks in the Background by Ortuscbq - Jobs and Tasks in the Background by Ortus
cbq - Jobs and Tasks in the Background by Ortus
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
 
一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理
一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理
一比一原版宾夕法尼亚大学毕业证(UPenn毕业证书)学历如何办理
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Major Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara ConferenceMajor Outages in Major Enterprises Payara Conference
Major Outages in Major Enterprises Payara Conference
 

Internal workshop react-js-mruiz

  • 1. React A JS library for building user interfaces
  • 2. What we will see... ● Meet React ● Fundamentals ● Components + JSX ● Props, PropType and State ● React Lifecycle ● Demo ● Want more?
  • 4. 1. Not jet another JS Framework 2. Just a library for creating User Interfaces 3. Renders your UI and respond to events
  • 5. > ReactJS has no... ● Controllers ● Directives ● Templates ● Global Event listeners ● Models > Just components! First fundamental... Everything is a COMPONENT
  • 6. > Changes always flow down via props, never up > Callbacks and actions will flow up Second fundamental... Unidirectional Data Flow
  • 7. 1. React builds a new virtual DOM subtree 2. Diffs it with the old one 3. Computes the minimal set of DOM mutations and puts them in a queue 4. Batch executes all updates Third fundamental… Virtual DOM Makes re-rendering on every change fast
  • 8. Creating components “We think that markup and the code that generates it are intimately tied together” React Docs
  • 9. ● Every component has state and props ● Data is handled from parent to child ● Owner-ownee VS Parents-Children ● It acts as an inmutable DOM and re- render de app once the state changes wait...what´s {that}?...Angular? Component example
  • 11. > Why should we learn another template language? JSX
  • 12. JSX → Javascript Syntax Extension that looks similar to XML 1. JSX is faster because it performs optimization while compiling code to JavaScript 2. It is also type-safe and most of the errors can be caught during compilation JSX
  • 13. > Easy right? React conversions
  • 15. > Used to pass parameters from parent to childrenProps
  • 16. PropTypes > Used to catch a lot of bug by typechecking props
  • 17. > When should I use state? Respond to user input Server requests The passage of time > Calling setState({...}) re-renders the component State
  • 18. > When should I use state? Respond to user input Server requests The passage of time > Just use props to pass data & event handlers down to your child components. Props vs State
  • 20. > componentDidMount() Make an Ajax request to fetch some data needed for this component > componentWillUnmount() Remove any listeners you initially set up > componentDidMount() Set up any listeners (ie Websockets or Firebase listeners) https://staminaloops.github.io/ undefinedisnotafunction/images/ react-lifecycle.jpg Lifecycle
  • 21. > Demo has: - Webpack (Babel & Imports) - React Hot Loader - Bootstrap 3 > Steps to reproduce: - git clone https://github.com/B ackSpaceTech/react- bootstrap- boilerplate - npm i && npm start DEMO TIME