SlideShare uma empresa Scribd logo
1 de 30
Baixar para ler offline
Introduction to React
About Me
● Solutions integrator
at Jumping Bean
– Developer & Trainer
– Social Media
● Twitter @mxc4
● Twitter
@jumpingbeansa
● LinkedIn
Application Architecture
Which Front-End Technology to Use?
What Front-End Technology To
Use?
● Mobile?
– Native vs HTML5
● Desktop?
– Thin Client/Fat Client
● Swing
● Web?
– HTML5,
– ECMAScript 5,6,7
– Frameworks
● HTML5/JavaScript
– Pros:
● Largest coverage,
– Cons:
● Not as fast, slick or
integrated as native
apps
The State of JavaScript
Frameworks
What to use for JS Front-End?
● Needed to redo a front-end
– Angular – Seemed to be the
emerging winner,
● Angular 1 versus Angular 2
– Others
● BackBone,
● Ember
● Where to go?
● I am Morpheus - Had to go
find “The One”
Is React the One?
What is React?
● JavaScript library from
– FaceBook
– Instagram
● “A JavaScript library for building user
interfaces”
● Originally built for Single Page Apps,
● Only the View part of an MVC framework
How is React Different?
● Existing frameworks
– add complexity,
– Introduce JavaScript meta-languages,
– Can be slow when number of interactive
components increase
● One way data-binding
● Two way data-binding is expensive and slow
React – A New Approach
● Declarative not imperative,
● UI built out of JavaScript defined components,
● One way data binding,
– Immutable UI
● Build components not templates
● Major innovation
– Virtual DOM
– Generates
Virtual DOM
● Abstracts away browser DOM,
● Translates from abstract DOM to concrete browser
DOM,
● Power behind one-way binding and UI updates
● Write to Virtual DOM and then “compile” to JavaScript
● On state change generate entire html page and then
generate differences and update
Virtual DOM – Update Flow
1)Calculate old and new tree,
2)Diff them:
– Two components of the same class will generate similar trees
– two components of different classes will generate different
trees.
– It is possible to provide a unique key for elements that is
stable across different renders
3) Update changed part of browser DOM
Simplified Explanation of React
● Create Virtual DOM components in JavaScript,
● Everything with interactivity is a React
component,
● State, i.e. changes propagate down component
hierarchy,
● Basic approach – file per component
React Component Creation - ES6
● Create components extending
React.Component,
● Implement render function,
● Return UI virtual DOM
Creating a React Component
JSX
● Optional HTML-like mark-up
● Declarative description of the UI inlined in JS code
● Combines ease-of-use of templates with power of
JavaScript
● Preprocessor translates to plain JavaScript:
● On the fly (suitable during development)
● Offline using the React CLI
Component Composition
How is Data/Model Provided to
Components?
● One way data binding means data change in one place,
– i.e only a component responsible for the data can change it,
– All other sub-components can only read it,
– If data is shared between components it is maintained in the
common ancestor
● Props way to pass data from parent to child,→
● State never leaves its containing component→
Component Hierarchies
● Breaking your app
into components
hierarchies is key,
● Understanding data
needs of components
determine where
state is kept
Data Flow – Data is immutable
● Data passed down hierarchy via
– this.props, properties are immutable,→
– this.state state should be held at the appropriate level in→
component hierarchy
● Parent components maintain state,
● How do child component changes to state propagate to
parent?
– Data passed up the hierarchy via parent event handlers being
called by child components
Data Flows Down Hierarchy via
Properties
Data Flow From Child to Parent
Declare Handler in Parent
Data Flow From Child To Parent
Fire Handler in Child
API Methods
● render()
– Return single child element,
– Can return null or false,
– Should not do read or write to the DOM,
– Best for server side rendering
● getInitialState() -
– Used to set the state before component is mounted,
API Methods
● getDefaultProps()
– Invoked on class creation then cached,
– Sets default values on missing props
● propTypes
– Used to validate props passed to component,
● statics
– Defines static methods for component
Component Life Cycle Events
● componentWillMount
– Invoked on client and server,
– Can be used to set state before render is called,
– Invoked on client and server before rendering
● componentDidMount
– Invoked only on client after rendering,
– Can access refs
● componentWillReceiveProps
– Not called for initial render,
– Used to setState
Component Life Cycle Events
● shouldComponentUpdate
– Return false to prevent updating
● componentWillUpdate
● componentDidUpdate,
● componentWillUnmount
Challenges to React?
● HTML 5 Web Components
– Custom components in HTML 5,
– Tied to Web browser DOM Model,
– Lots of reusable components will be available?
– How to integrate with React components
● Possible but do you want this?
● If you don't do it will anyone use your framework?
Mark Clarke @mxc4
Jumping Bean @jumpingbeansa
WWW: www.JumpingBean.co.za

Mais conteúdo relacionado

Mais procurados

Apache Any23 - Anything to Triples
Apache Any23 - Anything to TriplesApache Any23 - Anything to Triples
Apache Any23 - Anything to TriplesMichele Mostarda
 
Experiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the DatabaseExperiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the DatabaseMarcelo Ochoa
 
Javascript
JavascriptJavascript
JavascriptMozxai
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually restJakub Riedl
 
Writing Scalable React Applications: Introduction
Writing Scalable React Applications: IntroductionWriting Scalable React Applications: Introduction
Writing Scalable React Applications: IntroductionKlika Tech, Inc
 
Asynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringAsynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringNaresh Chintalcheru
 
How to add Fixtures into your Django app with Mixer
How to add Fixtures into your Django app with MixerHow to add Fixtures into your Django app with Mixer
How to add Fixtures into your Django app with MixerGuinsly Mondesir
 
Robust web apps with React.js
Robust web apps with React.jsRobust web apps with React.js
Robust web apps with React.jsMax Klymyshyn
 
Web development basics (Part-5)
Web development basics (Part-5)Web development basics (Part-5)
Web development basics (Part-5)Rajat Pratap Singh
 
Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionindiver
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application PlatformsNaresh Chintalcheru
 
Java Web services
Java Web servicesJava Web services
Java Web servicesSujit Kumar
 
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data typePostgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data typeJumping Bean
 
Akka - young fighter course
Akka - young fighter courseAkka - young fighter course
Akka - young fighter courseDmitriy Gutman
 

Mais procurados (19)

Apache Any23 - Anything to Triples
Apache Any23 - Anything to TriplesApache Any23 - Anything to Triples
Apache Any23 - Anything to Triples
 
Performance (browser)
Performance (browser)Performance (browser)
Performance (browser)
 
AngularJS
AngularJSAngularJS
AngularJS
 
Javascripts. pptt
Javascripts. ppttJavascripts. pptt
Javascripts. pptt
 
Experiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the DatabaseExperiences with Evangelizing Java Within the Database
Experiences with Evangelizing Java Within the Database
 
Websocket,JSON in JEE7
Websocket,JSON in JEE7Websocket,JSON in JEE7
Websocket,JSON in JEE7
 
Javascript
JavascriptJavascript
Javascript
 
GraphQL is actually rest
GraphQL is actually restGraphQL is actually rest
GraphQL is actually rest
 
Lokijs
LokijsLokijs
Lokijs
 
Writing Scalable React Applications: Introduction
Writing Scalable React Applications: IntroductionWriting Scalable React Applications: Introduction
Writing Scalable React Applications: Introduction
 
Asynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/SpringAsynchronous Processing in Java/JEE/Spring
Asynchronous Processing in Java/JEE/Spring
 
How to add Fixtures into your Django app with Mixer
How to add Fixtures into your Django app with MixerHow to add Fixtures into your Django app with Mixer
How to add Fixtures into your Django app with Mixer
 
Robust web apps with React.js
Robust web apps with React.jsRobust web apps with React.js
Robust web apps with React.js
 
Web development basics (Part-5)
Web development basics (Part-5)Web development basics (Part-5)
Web development basics (Part-5)
 
Using NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusionUsing NoSQL MongoDB with ColdFusion
Using NoSQL MongoDB with ColdFusion
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application Platforms
 
Java Web services
Java Web servicesJava Web services
Java Web services
 
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data typePostgrtesql as a NoSQL Document Store - The JSON/JSONB data type
Postgrtesql as a NoSQL Document Store - The JSON/JSONB data type
 
Akka - young fighter course
Akka - young fighter courseAkka - young fighter course
Akka - young fighter course
 

Destaque

The Creative Economy
The Creative EconomyThe Creative Economy
The Creative EconomyThe_IPA
 
Syd Uni professional learning
Syd Uni professional learningSyd Uni professional learning
Syd Uni professional learningCameron Paterson
 
Blogging and podcasting
Blogging and podcastingBlogging and podcasting
Blogging and podcastingAlek Davis
 
How it works under the hood with visual cobol
How it works under the hood with visual cobolHow it works under the hood with visual cobol
How it works under the hood with visual cobolMicro Focus
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryAlek Davis
 
Visual COBOL Development for Unix and Java
Visual COBOL Development for Unix and JavaVisual COBOL Development for Unix and Java
Visual COBOL Development for Unix and JavaMicro Focus
 
Menú Comedor Escolar
Menú Comedor EscolarMenú Comedor Escolar
Menú Comedor Escolarcpramonlaza
 
Lip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred Khallouf
Lip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred KhalloufLip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred Khallouf
Lip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred KhalloufAlfred Khallouf
 
Comprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred Khallouf
Comprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred KhalloufComprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred Khallouf
Comprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred KhalloufAlfred Khallouf
 
BIOETHICS INVOLVED IN CLONING
 BIOETHICS INVOLVED IN CLONING BIOETHICS INVOLVED IN CLONING
BIOETHICS INVOLVED IN CLONINGMohsin Shad
 
Medtech (bmls) laws & bioethics intro
Medtech (bmls) laws & bioethics introMedtech (bmls) laws & bioethics intro
Medtech (bmls) laws & bioethics introMEI MEI
 
'Documents.tips panduan penulisan-laporan-akhir-ptss.pdf'
'Documents.tips panduan penulisan-laporan-akhir-ptss.pdf''Documents.tips panduan penulisan-laporan-akhir-ptss.pdf'
'Documents.tips panduan penulisan-laporan-akhir-ptss.pdf'Afina Karim
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf toolsBrendan Gregg
 
La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...
La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...
La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...Bibiana Villa Vargas
 

Destaque (19)

The Creative Economy
The Creative EconomyThe Creative Economy
The Creative Economy
 
Updated CV 012116
Updated CV 012116Updated CV 012116
Updated CV 012116
 
Syd Uni professional learning
Syd Uni professional learningSyd Uni professional learning
Syd Uni professional learning
 
Blogging and podcasting
Blogging and podcastingBlogging and podcasting
Blogging and podcasting
 
t30.10
t30.10t30.10
t30.10
 
Snapshot
SnapshotSnapshot
Snapshot
 
How it works under the hood with visual cobol
How it works under the hood with visual cobolHow it works under the hood with visual cobol
How it works under the hood with visual cobol
 
Building intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQueryBuilding intranet applications with ASP.NET AJAX and jQuery
Building intranet applications with ASP.NET AJAX and jQuery
 
Creative Economy
Creative EconomyCreative Economy
Creative Economy
 
Visual COBOL Development for Unix and Java
Visual COBOL Development for Unix and JavaVisual COBOL Development for Unix and Java
Visual COBOL Development for Unix and Java
 
Menú Comedor Escolar
Menú Comedor EscolarMenú Comedor Escolar
Menú Comedor Escolar
 
Treatment 1 Naomi
Treatment 1 NaomiTreatment 1 Naomi
Treatment 1 Naomi
 
Lip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred Khallouf
Lip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred KhalloufLip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred Khallouf
Lip Reconstruction Following Traumatic Lip Injuries | Dr. Alfred Khallouf
 
Comprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred Khallouf
Comprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred KhalloufComprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred Khallouf
Comprehensive Care Treatment Plan Presentation, Part II | Dr. Alfred Khallouf
 
BIOETHICS INVOLVED IN CLONING
 BIOETHICS INVOLVED IN CLONING BIOETHICS INVOLVED IN CLONING
BIOETHICS INVOLVED IN CLONING
 
Medtech (bmls) laws & bioethics intro
Medtech (bmls) laws & bioethics introMedtech (bmls) laws & bioethics intro
Medtech (bmls) laws & bioethics intro
 
'Documents.tips panduan penulisan-laporan-akhir-ptss.pdf'
'Documents.tips panduan penulisan-laporan-akhir-ptss.pdf''Documents.tips panduan penulisan-laporan-akhir-ptss.pdf'
'Documents.tips panduan penulisan-laporan-akhir-ptss.pdf'
 
Velocity 2015 linux perf tools
Velocity 2015 linux perf toolsVelocity 2015 linux perf tools
Velocity 2015 linux perf tools
 
La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...
La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...
La ciudad un escenario para el desarrollo de com petencias cientificas y ciud...
 

Semelhante a React - The JavaScript Library for User Interfaces

JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendVlad Fedosov
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-endJordi Anguela
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JSFestUA
 
Joomla!Day Poland 2013 - Joomla Architecture (Ofer Cohen)
Joomla!Day Poland 2013 - Joomla Architecture  (Ofer Cohen)Joomla!Day Poland 2013 - Joomla Architecture  (Ofer Cohen)
Joomla!Day Poland 2013 - Joomla Architecture (Ofer Cohen)Ofer Cohen
 
Jab12 - Joomla! architecture revealed
Jab12 - Joomla! architecture revealedJab12 - Joomla! architecture revealed
Jab12 - Joomla! architecture revealedOfer Cohen
 
React learning in the hard way
React   learning in the hard wayReact   learning in the hard way
React learning in the hard wayChen Feldman
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsFRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsLeapfrog Technology Inc.
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Previewvaluebound
 
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa..."Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa...Fwdays
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
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 .pptxSHAIKIRFAN715544
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react jsStephieJohn
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptxSHAIKIRFAN715544
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
Building RESTtful services in MEAN
Building RESTtful services in MEANBuilding RESTtful services in MEAN
Building RESTtful services in MEANMadhukara Phatak
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react nativeDani Akash
 

Semelhante a React - The JavaScript Library for User Interfaces (20)

JSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontendJSFest 2019: Technology agnostic microservices at SPA frontend
JSFest 2019: Technology agnostic microservices at SPA frontend
 
Professionalizing the Front-end
Professionalizing the Front-endProfessionalizing the Front-end
Professionalizing the Front-end
 
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
JS Fest 2019/Autumn. Влад Федосов. Technology agnostic microservices at SPA f...
 
Joomla!Day Poland 2013 - Joomla Architecture (Ofer Cohen)
Joomla!Day Poland 2013 - Joomla Architecture  (Ofer Cohen)Joomla!Day Poland 2013 - Joomla Architecture  (Ofer Cohen)
Joomla!Day Poland 2013 - Joomla Architecture (Ofer Cohen)
 
Jab12 - Joomla! architecture revealed
Jab12 - Joomla! architecture revealedJab12 - Joomla! architecture revealed
Jab12 - Joomla! architecture revealed
 
React learning in the hard way
React   learning in the hard wayReact   learning in the hard way
React learning in the hard way
 
Reactjs
Reactjs Reactjs
Reactjs
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and PatternsFRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
FRU Kathmandu: Adopting with Change Frontend Architecture and Patterns
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa..."Crafting a Third-Party Banking Library with Web Components and React", Germa...
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Next.js with drupal, the good parts
Next.js with drupal, the good partsNext.js with drupal, the good parts
Next.js with drupal, the good parts
 
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
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
Building RESTtful services in MEAN
Building RESTtful services in MEANBuilding RESTtful services in MEAN
Building RESTtful services in MEAN
 
Introduction to react native
Introduction to react nativeIntroduction to react native
Introduction to react native
 

Mais de Jumping Bean

DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017Jumping Bean
 
IPv6 How To Set Up a Linux IPv6 Lan
IPv6 How To Set Up  a Linux IPv6 LanIPv6 How To Set Up  a Linux IPv6 Lan
IPv6 How To Set Up a Linux IPv6 LanJumping Bean
 
HTML 5 & The Modern Web
HTML 5 & The Modern WebHTML 5 & The Modern Web
HTML 5 & The Modern WebJumping Bean
 
Building games-with-libgdx
Building games-with-libgdxBuilding games-with-libgdx
Building games-with-libgdxJumping Bean
 
Linux Containers & Docker
Linux Containers & DockerLinux Containers & Docker
Linux Containers & DockerJumping Bean
 
Introduction to Web Sockets
Introduction to Web SocketsIntroduction to Web Sockets
Introduction to Web SocketsJumping Bean
 
Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South Africa
Secrets of a linux ninja  Software Freedom Day 2013 Johannesburg, South AfricaSecrets of a linux ninja  Software Freedom Day 2013 Johannesburg, South Africa
Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South AfricaJumping Bean
 
M-Learning application development with open source
M-Learning application development with open sourceM-Learning application development with open source
M-Learning application development with open sourceJumping Bean
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSJumping Bean
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android DevelopmentJumping Bean
 
Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An IntroductionJumping Bean
 
IPv6 - Jozi Linux User Group Presentation
IPv6  - Jozi Linux User Group PresentationIPv6  - Jozi Linux User Group Presentation
IPv6 - Jozi Linux User Group PresentationJumping Bean
 
SELinux Johannesburg Linux User Group (JoziJUg)
SELinux Johannesburg Linux User Group (JoziJUg)SELinux Johannesburg Linux User Group (JoziJUg)
SELinux Johannesburg Linux User Group (JoziJUg)Jumping Bean
 

Mais de Jumping Bean (14)

DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
DevOpsDaysCPT Ansible Infrastrucutre as Code 2017
 
IPv6 How To Set Up a Linux IPv6 Lan
IPv6 How To Set Up  a Linux IPv6 LanIPv6 How To Set Up  a Linux IPv6 Lan
IPv6 How To Set Up a Linux IPv6 Lan
 
HTML 5 & The Modern Web
HTML 5 & The Modern WebHTML 5 & The Modern Web
HTML 5 & The Modern Web
 
Building games-with-libgdx
Building games-with-libgdxBuilding games-with-libgdx
Building games-with-libgdx
 
Linux Containers & Docker
Linux Containers & DockerLinux Containers & Docker
Linux Containers & Docker
 
Introduction to Web Sockets
Introduction to Web SocketsIntroduction to Web Sockets
Introduction to Web Sockets
 
Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South Africa
Secrets of a linux ninja  Software Freedom Day 2013 Johannesburg, South AfricaSecrets of a linux ninja  Software Freedom Day 2013 Johannesburg, South Africa
Secrets of a linux ninja Software Freedom Day 2013 Johannesburg, South Africa
 
M-Learning application development with open source
M-Learning application development with open sourceM-Learning application development with open source
M-Learning application development with open source
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to Android Development
Introduction to Android DevelopmentIntroduction to Android Development
Introduction to Android Development
 
Glassfish An Introduction
Glassfish An IntroductionGlassfish An Introduction
Glassfish An Introduction
 
Java logging
Java loggingJava logging
Java logging
 
IPv6 - Jozi Linux User Group Presentation
IPv6  - Jozi Linux User Group PresentationIPv6  - Jozi Linux User Group Presentation
IPv6 - Jozi Linux User Group Presentation
 
SELinux Johannesburg Linux User Group (JoziJUg)
SELinux Johannesburg Linux User Group (JoziJUg)SELinux Johannesburg Linux User Group (JoziJUg)
SELinux Johannesburg Linux User Group (JoziJUg)
 

Último

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

React - The JavaScript Library for User Interfaces

  • 2. About Me ● Solutions integrator at Jumping Bean – Developer & Trainer – Social Media ● Twitter @mxc4 ● Twitter @jumpingbeansa ● LinkedIn
  • 5. What Front-End Technology To Use? ● Mobile? – Native vs HTML5 ● Desktop? – Thin Client/Fat Client ● Swing ● Web? – HTML5, – ECMAScript 5,6,7 – Frameworks ● HTML5/JavaScript – Pros: ● Largest coverage, – Cons: ● Not as fast, slick or integrated as native apps
  • 6. The State of JavaScript Frameworks
  • 7. What to use for JS Front-End? ● Needed to redo a front-end – Angular – Seemed to be the emerging winner, ● Angular 1 versus Angular 2 – Others ● BackBone, ● Ember ● Where to go? ● I am Morpheus - Had to go find “The One”
  • 9. What is React? ● JavaScript library from – FaceBook – Instagram ● “A JavaScript library for building user interfaces” ● Originally built for Single Page Apps, ● Only the View part of an MVC framework
  • 10. How is React Different? ● Existing frameworks – add complexity, – Introduce JavaScript meta-languages, – Can be slow when number of interactive components increase ● One way data-binding ● Two way data-binding is expensive and slow
  • 11. React – A New Approach ● Declarative not imperative, ● UI built out of JavaScript defined components, ● One way data binding, – Immutable UI ● Build components not templates ● Major innovation – Virtual DOM – Generates
  • 12. Virtual DOM ● Abstracts away browser DOM, ● Translates from abstract DOM to concrete browser DOM, ● Power behind one-way binding and UI updates ● Write to Virtual DOM and then “compile” to JavaScript ● On state change generate entire html page and then generate differences and update
  • 13. Virtual DOM – Update Flow 1)Calculate old and new tree, 2)Diff them: – Two components of the same class will generate similar trees – two components of different classes will generate different trees. – It is possible to provide a unique key for elements that is stable across different renders 3) Update changed part of browser DOM
  • 14. Simplified Explanation of React ● Create Virtual DOM components in JavaScript, ● Everything with interactivity is a React component, ● State, i.e. changes propagate down component hierarchy, ● Basic approach – file per component
  • 15. React Component Creation - ES6 ● Create components extending React.Component, ● Implement render function, ● Return UI virtual DOM
  • 16. Creating a React Component
  • 17. JSX ● Optional HTML-like mark-up ● Declarative description of the UI inlined in JS code ● Combines ease-of-use of templates with power of JavaScript ● Preprocessor translates to plain JavaScript: ● On the fly (suitable during development) ● Offline using the React CLI
  • 19. How is Data/Model Provided to Components? ● One way data binding means data change in one place, – i.e only a component responsible for the data can change it, – All other sub-components can only read it, – If data is shared between components it is maintained in the common ancestor ● Props way to pass data from parent to child,→ ● State never leaves its containing component→
  • 20. Component Hierarchies ● Breaking your app into components hierarchies is key, ● Understanding data needs of components determine where state is kept
  • 21. Data Flow – Data is immutable ● Data passed down hierarchy via – this.props, properties are immutable,→ – this.state state should be held at the appropriate level in→ component hierarchy ● Parent components maintain state, ● How do child component changes to state propagate to parent? – Data passed up the hierarchy via parent event handlers being called by child components
  • 22. Data Flows Down Hierarchy via Properties
  • 23. Data Flow From Child to Parent Declare Handler in Parent
  • 24. Data Flow From Child To Parent Fire Handler in Child
  • 25. API Methods ● render() – Return single child element, – Can return null or false, – Should not do read or write to the DOM, – Best for server side rendering ● getInitialState() - – Used to set the state before component is mounted,
  • 26. API Methods ● getDefaultProps() – Invoked on class creation then cached, – Sets default values on missing props ● propTypes – Used to validate props passed to component, ● statics – Defines static methods for component
  • 27. Component Life Cycle Events ● componentWillMount – Invoked on client and server, – Can be used to set state before render is called, – Invoked on client and server before rendering ● componentDidMount – Invoked only on client after rendering, – Can access refs ● componentWillReceiveProps – Not called for initial render, – Used to setState
  • 28. Component Life Cycle Events ● shouldComponentUpdate – Return false to prevent updating ● componentWillUpdate ● componentDidUpdate, ● componentWillUnmount
  • 29. Challenges to React? ● HTML 5 Web Components – Custom components in HTML 5, – Tied to Web browser DOM Model, – Lots of reusable components will be available? – How to integrate with React components ● Possible but do you want this? ● If you don't do it will anyone use your framework?
  • 30. Mark Clarke @mxc4 Jumping Bean @jumpingbeansa WWW: www.JumpingBean.co.za