SlideShare ist ein Scribd-Unternehmen logo
1 von 26
18.08.2016
Fatih Şimşek - Software Infrastructure
React
React
Open source Javascript Library
Created by Jordan Walke, a software engineer at Facebook
First deployed on Facebook’s newsfeed in 2011
Maintained by Facebook, Instagram and a community of
individual developers and corporations
Who is using React?
9flats - Airbnb - Alipay - Atlassian - BBC - Box - Capital One -
Coursera -Dailymotion - Deezer - Docker - Expedia - Facebook -
Fotocasa - HappyFresh - IMDb - Instacart - Instagram - Khan
Academy - Klarna - Lyft - NBC - Netflix - NFL - Paypal - Periscope -
Ralph Lauren - Reddit – Salesforce - Sberbank - Stack Overflow -
Tesla - Tmall - The New York Times - Twitter Fabric - Twitter
Mobile - Uber - WhatsApp - Wired - Yahoo - Zendesk
https://github.com/facebook/react/wiki/Sites-Using-React
Github
React
Creating user interface(V in MVC model)
Speed
Declarative
Composable
Learn Once, Write Anywhere
Support ES6
Testable
Write once, Run Everywhere
React
Architecture
Architecture
Component manage own state
One way binding
JSX
Virtual DOM
Component Lifecycle
JSX
Supports xml-like syntax inline in JavaScript
Each element is transformed into a Javascript function call
• <Hello /> => Hello(null)
• <div /> => React.DOM.div(null)
Virtual DOM
Problem:
• DOM manipulation is expensive
• Touching DOM is hard to test
• Re-render all parts of DOM make your app slowly
Virtual DOM
Solution:
When the component’s state is changed, React
• Use different algorithm with the browser DOM tree to
identify the changes
• Instead of creating new object, React just identify what
change is took place and once identify update that state
• Render the subtree of DOM elements into the rendering of
the DOM
Virtual DOM
DEMO
Prop / State
Prop:
• Used to pass parameter from parent to children
• PropTypes used to validate properties
• getDefaultProps
State:
• Used to manage state inside component
• getInitialState
• setState
Prop / State
Mixins / Statics
Mixins:
• Different components may share some common functionality
• Several mixins can be defined
• Methods defined on mixins run in the order mixins were
listed
Statics:
• Like .Net / Java static method
• Define static methods in statics block of component
Events
componentWillMount: Invoked once before the initial render
componentDidMount: Invoked once, only on the client
componentWillReceiveProps: Invoked when a component is receiving new props
shouldComponentUpdate: Invoked before rendering when new props or state are
being received
componentWillUpdate: Invoked immediately before rendering when new props or
state are being received
componentDidUpdate: Invoked immediately after the component's updates are
flushed to the DOM
componentWillUnmount: Invoked immediately before a component is
unmounted from the DOM
Initial Phase
Lifecycle
Update Phase
DEMO
Flux
Action: Helper method that facilitate passing data
to the Dispatcher
Dispatcher: Receive action and broadcast
payload to registered callback
Store: Containers for application state & logic that
have callbacks registered to the dispatcher
View: State from Stores and pass it down via props
to child components
Flux
Redux
• Single source of truth
• State is read-only
• Mutations are written
as pure functions
(reducers)
Redux
• Important difference to Flux: no dispatching inside the action
• There is no Dispatcher at all; pure functions do not need to
be managed, they need to be composed
• Mutations are written as pure functions
Benchmark
ReactJS

Weitere ähnliche Inhalte

Was ist angesagt?

Calling APIs with SharePoint Framework
Calling APIs with SharePoint FrameworkCalling APIs with SharePoint Framework
Calling APIs with SharePoint FrameworkGiuseppe Marchi
 
DevOps and Continuous Delivery reference architectures for Docker
DevOps and Continuous Delivery reference architectures for DockerDevOps and Continuous Delivery reference architectures for Docker
DevOps and Continuous Delivery reference architectures for DockerSonatype
 
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Matt Raible
 
Lo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJSLo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJSMarcel Kalveram
 
Git workflow
Git workflowGit workflow
Git workflowArif Huda
 
React Native in a nutshell
React Native in a nutshellReact Native in a nutshell
React Native in a nutshellBrainhub
 
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...Codemotion
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamJoe Ferguson
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testingJoe Ferguson
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementJoe Ferguson
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesSauce Labs
 
warblecamp - twical
warblecamp - twical warblecamp - twical
warblecamp - twical Angus Fox
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsJimit Shah
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.Bobby Schultz
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Nicholas Jansma
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumSauce Labs
 

Was ist angesagt? (20)

Succeeding with FOSS!
Succeeding with FOSS!Succeeding with FOSS!
Succeeding with FOSS!
 
Calling APIs with SharePoint Framework
Calling APIs with SharePoint FrameworkCalling APIs with SharePoint Framework
Calling APIs with SharePoint Framework
 
DevOps and Continuous Delivery reference architectures for Docker
DevOps and Continuous Delivery reference architectures for DockerDevOps and Continuous Delivery reference architectures for Docker
DevOps and Continuous Delivery reference architectures for Docker
 
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
Building a PWA with Ionic, Angular, and Spring Boot - GeeCON 2017
 
Lo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJSLo mejor y peor de React Native @ValenciaJS
Lo mejor y peor de React Native @ValenciaJS
 
Git workflow
Git workflowGit workflow
Git workflow
 
React Native in a nutshell
React Native in a nutshellReact Native in a nutshell
React Native in a nutshell
 
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...React Native for multi-platform mobile applications  - Matteo Manchi - Codemo...
React Native for multi-platform mobile applications - Matteo Manchi - Codemo...
 
Midwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small teamMidwest PHP 2017 DevOps For Small team
Midwest PHP 2017 DevOps For Small team
 
Put an end to regression with codeception testing
Put an end to regression with codeception testingPut an end to regression with codeception testing
Put an end to regression with codeception testing
 
Composer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency ManagementComposer at Scale, Release and Dependency Management
Composer at Scale, Release and Dependency Management
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
 
warblecamp - twical
warblecamp - twical warblecamp - twical
warblecamp - twical
 
React native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile AppsReact native - React(ive) Way To Build Native Mobile Apps
React native - React(ive) Way To Build Native Mobile Apps
 
When to (use / not use) React Native.
When to (use / not use) React Native.When to (use / not use) React Native.
When to (use / not use) React Native.
 
Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)Appcelerator Titanium Intro (2014)
Appcelerator Titanium Intro (2014)
 
Android Studio vs. ADT
Android Studio vs. ADTAndroid Studio vs. ADT
Android Studio vs. ADT
 
Lezione 03 Introduzione a react
Lezione 03   Introduzione a reactLezione 03   Introduzione a react
Lezione 03 Introduzione a react
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
 

Andere mochten auch

Tabella maschile record distensione su panca - Regione Puglia
Tabella maschile record distensione su panca - Regione PugliaTabella maschile record distensione su panca - Regione Puglia
Tabella maschile record distensione su panca - Regione Pugliagreanri
 
Casamiento de cleopatra(2)
Casamiento de cleopatra(2)Casamiento de cleopatra(2)
Casamiento de cleopatra(2)Nicol Neumann
 
Agenda Primera Sesión Formación ABC en Uribia Guajira
Agenda Primera Sesión Formación ABC en Uribia GuajiraAgenda Primera Sesión Formación ABC en Uribia Guajira
Agenda Primera Sesión Formación ABC en Uribia Guajiralesbia0808
 
Wowecoin comp profile
Wowecoin comp profileWowecoin comp profile
Wowecoin comp profileWOWCOIN
 
Tabella maschile record distensione su panca
Tabella maschile record distensione su pancaTabella maschile record distensione su panca
Tabella maschile record distensione su pancagreanri
 
Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3
Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3
Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3Галина Сызько
 
Презентація опорного закладу з БЖ та ОЗ
Презентація опорного закладу з БЖ та ОЗ Презентація опорного закладу з БЖ та ОЗ
Презентація опорного закладу з БЖ та ОЗ Андрій Лубенець
 
Realm.io for iOS
Realm.io for iOSRealm.io for iOS
Realm.io for iOSEunjoo Im
 
РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...
РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...
РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...Тарасов Константин
 
CocoaHeads Lyon 17/12/2011 : Arc
CocoaHeads Lyon 17/12/2011 : ArcCocoaHeads Lyon 17/12/2011 : Arc
CocoaHeads Lyon 17/12/2011 : ArcCocoaHeads Lyon
 

Andere mochten auch (14)

Node js
Node jsNode js
Node js
 
Tabella maschile record distensione su panca - Regione Puglia
Tabella maschile record distensione su panca - Regione PugliaTabella maschile record distensione su panca - Regione Puglia
Tabella maschile record distensione su panca - Regione Puglia
 
Casamiento de cleopatra(2)
Casamiento de cleopatra(2)Casamiento de cleopatra(2)
Casamiento de cleopatra(2)
 
Agenda Primera Sesión Formación ABC en Uribia Guajira
Agenda Primera Sesión Formación ABC en Uribia GuajiraAgenda Primera Sesión Formación ABC en Uribia Guajira
Agenda Primera Sesión Formación ABC en Uribia Guajira
 
Wowecoin comp profile
Wowecoin comp profileWowecoin comp profile
Wowecoin comp profile
 
Tabella maschile record distensione su panca
Tabella maschile record distensione su pancaTabella maschile record distensione su panca
Tabella maschile record distensione su panca
 
Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3
Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3
Огляд нових надходжень до шкільної бібліотеки Золотоніської ЗОШ №3
 
Презентація опорного закладу з БЖ та ОЗ
Презентація опорного закладу з БЖ та ОЗ Презентація опорного закладу з БЖ та ОЗ
Презентація опорного закладу з БЖ та ОЗ
 
Software per la gestione completa dei centri fitness e wellness: Gymgest
Software per la gestione completa dei centri fitness e wellness: GymgestSoftware per la gestione completa dei centri fitness e wellness: Gymgest
Software per la gestione completa dei centri fitness e wellness: Gymgest
 
Realm.io for iOS
Realm.io for iOSRealm.io for iOS
Realm.io for iOS
 
IoC and Mapper in C#
IoC and Mapper in C#IoC and Mapper in C#
IoC and Mapper in C#
 
РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...
РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...
РИФ 2016, Как сделать клиента счастливее и повысить фин. результаты. Опыт сер...
 
CocoaHeads Lyon 17/12/2011 : Arc
CocoaHeads Lyon 17/12/2011 : ArcCocoaHeads Lyon 17/12/2011 : Arc
CocoaHeads Lyon 17/12/2011 : Arc
 
Interfaz java y arduino
Interfaz java y arduinoInterfaz java y arduino
Interfaz java y arduino
 

Ähnlich wie ReactJS

Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React nativeDhaval Barot
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMJimit Shah
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React NativeMike Melusky
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = JoyJohn Need
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison500Tech
 
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
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit TestingEswara Kumar Palakollu
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React BasicsRich Ross
 
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
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react jsStephieJohn
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and ReactMike Melusky
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and ReduxMaxime Najim
 
GITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Indonesia
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementZach Lendon
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Zach Lendon
 

Ähnlich wie ReactJS (20)

Introduction to React native
Introduction to React nativeIntroduction to React native
Introduction to React native
 
React a11y-csun
React a11y-csunReact a11y-csun
React a11y-csun
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
 
Fluxible
FluxibleFluxible
Fluxible
 
An evening with React Native
An evening with React NativeAn evening with React Native
An evening with React Native
 
React + Flux = Joy
React + Flux = JoyReact + Flux = Joy
React + Flux = Joy
 
React Native Firebase
React Native FirebaseReact Native Firebase
React Native Firebase
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
 
Reactjs
Reactjs Reactjs
Reactjs
 
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
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
 
20171108 PDN HOL React Basics
20171108 PDN HOL React Basics20171108 PDN HOL React Basics
20171108 PDN HOL React Basics
 
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
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Progressive Web Apps and React
Progressive Web Apps and ReactProgressive Web Apps and React
Progressive Web Apps and React
 
Building Modern Web Applications using React and Redux
 Building Modern Web Applications using React and Redux Building Modern Web Applications using React and Redux
Building Modern Web Applications using React and Redux
 
GITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React NativeGITS Class #20: Building A Fast and Responsive UI in React Native
GITS Class #20: Building A Fast and Responsive UI in React Native
 
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer ReplacementMidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
 
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
 

Kürzlich hochgeladen

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 

Kürzlich hochgeladen (20)

Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 

ReactJS

  • 1. 18.08.2016 Fatih Şimşek - Software Infrastructure React
  • 2. React Open source Javascript Library Created by Jordan Walke, a software engineer at Facebook First deployed on Facebook’s newsfeed in 2011 Maintained by Facebook, Instagram and a community of individual developers and corporations
  • 3. Who is using React? 9flats - Airbnb - Alipay - Atlassian - BBC - Box - Capital One - Coursera -Dailymotion - Deezer - Docker - Expedia - Facebook - Fotocasa - HappyFresh - IMDb - Instacart - Instagram - Khan Academy - Klarna - Lyft - NBC - Netflix - NFL - Paypal - Periscope - Ralph Lauren - Reddit – Salesforce - Sberbank - Stack Overflow - Tesla - Tmall - The New York Times - Twitter Fabric - Twitter Mobile - Uber - WhatsApp - Wired - Yahoo - Zendesk https://github.com/facebook/react/wiki/Sites-Using-React
  • 5. React Creating user interface(V in MVC model) Speed Declarative Composable Learn Once, Write Anywhere Support ES6 Testable
  • 6. Write once, Run Everywhere React
  • 8. Architecture Component manage own state One way binding JSX Virtual DOM Component Lifecycle
  • 9. JSX Supports xml-like syntax inline in JavaScript Each element is transformed into a Javascript function call • <Hello /> => Hello(null) • <div /> => React.DOM.div(null)
  • 10. Virtual DOM Problem: • DOM manipulation is expensive • Touching DOM is hard to test • Re-render all parts of DOM make your app slowly
  • 11. Virtual DOM Solution: When the component’s state is changed, React • Use different algorithm with the browser DOM tree to identify the changes • Instead of creating new object, React just identify what change is took place and once identify update that state • Render the subtree of DOM elements into the rendering of the DOM
  • 13. DEMO
  • 14. Prop / State Prop: • Used to pass parameter from parent to children • PropTypes used to validate properties • getDefaultProps State: • Used to manage state inside component • getInitialState • setState
  • 16. Mixins / Statics Mixins: • Different components may share some common functionality • Several mixins can be defined • Methods defined on mixins run in the order mixins were listed Statics: • Like .Net / Java static method • Define static methods in statics block of component
  • 17. Events componentWillMount: Invoked once before the initial render componentDidMount: Invoked once, only on the client componentWillReceiveProps: Invoked when a component is receiving new props shouldComponentUpdate: Invoked before rendering when new props or state are being received componentWillUpdate: Invoked immediately before rendering when new props or state are being received componentDidUpdate: Invoked immediately after the component's updates are flushed to the DOM componentWillUnmount: Invoked immediately before a component is unmounted from the DOM
  • 19. DEMO
  • 20.
  • 21. Flux Action: Helper method that facilitate passing data to the Dispatcher Dispatcher: Receive action and broadcast payload to registered callback Store: Containers for application state & logic that have callbacks registered to the dispatcher View: State from Stores and pass it down via props to child components
  • 22. Flux
  • 23. Redux • Single source of truth • State is read-only • Mutations are written as pure functions (reducers)
  • 24. Redux • Important difference to Flux: no dispatching inside the action • There is no Dispatcher at all; pure functions do not need to be managed, they need to be composed • Mutations are written as pure functions

Hinweis der Redaktion

  1. In 2010, Facebook released an extension for PHP called XHP. XHP help to decrease XSS attack and make front-end much both readable and understand. There was a distinct problem with XHP: dynamic webapplications require many roundtrips to the server. XHP did not solve this problem. Jordan Walke negotiated with his manager to take XHP into the browser using JavaScript and was granted six months to try it It was first deployed on Facebook's newsfeed in 2011 and later on Instagram.com in 2012. It was open-sourced at JSConf US in May 2013. React Native, which enables native iOS and Android development with React, was announced at Facebook's React.js Conf in February 2015 and open-sourced in March 2015.
  2. http://reactkungfu.com/2015/07/big-names-using-react-js/ Netflix – React Conf 2015 https://www.youtube.com/watch?v=eNC0mRYGWgc Sberbank - the number one bank in Russia I must say, I was really shocked when I heard that the interactive part of bank’s website was developed in React. One of the developers working on that project shared his team’s experience on React’s Google Group. They were really happy about the speed of development with React. https://groups.google.com/forum/#!topic/reactjs/Kj6WATX0atg At Instagram we migrated from the standard Mustache/Backbone/jQuery trio to React with a little bit of Backbone. One big benefit of this move was that we could express our display logic with pure JS, so we can use all the standard object-oriented and procedural techniques to reuse code
  3. Speed! Render < 16ms Declarative Easier to reason about Easier to prevent bugs Composable ( build larger tree with Learn Once, Write Anywhere ( Mobile, Web )
  4. Facebook has been working to help build a cross-platform development platform called React. Earlier this year, Facebook announced React Native, a learn-once, run-everywhere platform to take JavaScript and build native-like apps for iOS and Android. Run on server-side on NodeJs. Discontinuing IE8 support in React DOM, January 2016.
  5. Data flow from the parent to the children component by the state and the props Only one parent is responsible to update the states and passing the value to the children components via props setState is used to update/refresh the UI when the state change and the value can be pass to the children component by the this.props Event flow up, data flow down
  6. Transform JSX to pure JavaScript immediately before execution Convenient for the developer Significant performance penalty Can’t be minified Use Babel.js / JSXTransformer.js deprecated https://babeljs.io/repl/
  7. http://www.slideshare.net/emadb/an-introduction-to-reactjs-46258876
  8. Simple Render (Hello World)
  9. https://facebook.github.io/react/docs/reusable-components.html
  10. componentWillMount: Good place to make connection to your db service componentDidMount: It is good place for you to make AJAX request to fetch data for first used. componentWillReceiveProps: Use this method as a way to react to a prop change before render() is called by updating the state with setState. componentWillUnmount: Perform any necessary cleanup in this method(Ex: invalidating timers, clear up DOM elements were created at componentDidMount)
  11. http://www.slideshare.net/xmlilley/react-flux-50660816 (23.slide)
  12. Sample Jquery / Knockout / AngularJs / React http://getbootstrap.com/css/#forms http://getbootstrap.com/components/#list-group http://getbootstrap.com/components/#glyphicons-examples
  13. Flux is an architecture that Facebook uses internally when working with React. It isnot a framework or a library. It is simply a new kind of architecture that complements React and the concept of Unidirectional Data Flow. Dispatcher is the central hub that manages all data flow, It is a registry of callbacks into the stores Action typically triggered by the View, contain information about change made to the application Store contain application state and logic, reacts to specific action. View has list of stores which provide data for, trigger action with the state changes
  14. After you use Flux the first time, writing React without Flux feels like DOM traversal without jQuery. You can absolutely do it, but it feels less elegant and structured. Flummox, Alt, Fluxxor are libraries implement Flux. https://scotch.io/tutorials/creating-a-simple-shopping-cart-with-react-js-and-flux http://fluxxor.com/examples/carousel/
  15. Actions are payloads of information that send data from your application to your store Reducer is a pure function that takes the previous state and an action, and returns the next state. Store is the object that brings them together. (holds application state) You call store.dispatch(action) The Redux store calls the reducer function you gave it The root reducer may combine the output of multiple reducers into a single state tree The Redux store saves the complete state tree returned by the root reducer
  16. BenchMark Site: https://cdn.rawgit.com/krausest/js-framework-benchmark/a358bc967e1d9ff0c268b43f5ab8b832abe0476e/webdriver-java/table.html https://github.com/krausest/js-framework-benchmark React & Angular2 http://www.slideshare.net/boyney123/reactjs-or-angular?qid=f24b044d-6e77-4eaa-b4f4-882c5a56f454&v=&b=&from_search=15