SlideShare ist ein Scribd-Unternehmen logo
1 von 56
Downloaden Sie, um offline zu lesen
@bolshchikov
Pragmatic React
Workshop
Sergey Bolshchikov, Team Lead @ Wix
Itai Ben David, Guild Master @ Wix
linkedin/bolshchikov github.com/bolshchikov@bolshchikovsergeyb@wix.com
@bolshchikov
Hi.
We are Sergey and Itai.
@bolshchikov 2
@bolshchikov
Your turn...
1. What’s your name?
2. Your previous
experience with front
end and React?
3. Top thing you want to
learn today?
@bolshchikov 3
@bolshchikov
To give the necessary knowledge
and understanding about React in
order to write the application
@bolshchikov
Our goal
4
@bolshchikov
AGENDA
1. The state of front end now
2. React ecosystem
3. React: before and after
4. Design React application
5. React Syntax
1. Representational
components
2. Container components
6. Life-cycle management
7. Hand-on part
@bolshchikov 5
@bolshchikov
Front End
Ecosystem
01
@bolshchikov 6
@bolshchikov@bolshchikov
https://coggle.it/diagram
/52e97f8c5a143de23900
5d1b/56212c4e4c505e0
045c0d3bda59b77e5977
c2c9bd40f3fd0b451bdcf
8da4aa52
7
@bolshchikov@bolshchikov
https://coggle.it/diagram
/52e97f8c5a143de23900
5d1b/56212c4e4c505e0
045c0d3bda59b77e5977
c2c9bd40f3fd0b451bdcf
8da4aa52
We are here
8
@bolshchikov
React
Ecosystem
02
@bolshchikov 9
@bolshchikov@bolshchikov
https://coggle.it/diagram
/52e97f8c5a143de23900
5d1b/56212c4e4c505e0
045c0d3bda59b77e5977
c2c9bd40f3fd0b451bdcf
8da4aa52
There is still more
to learn
10
@bolshchikov
React:
Before and After
03
@bolshchikov 11
@bolshchikov 12
https://trends.google.co
m/trends/explore?cat=13
&q=angularjs,reactGoogle Trends
@bolshchikov
React: Before
▪ MV* approach
▪ Angular is the most popular framework
▪ Two-way binding (magic)
▪ HTML Templates
▪ Services/Factories/Directives/Config/Run/etc…
▪ Full-blown framework
@bolshchikov 13
@bolshchikov
React: After
▪ Simple library
▪ Challenges best practices
▪ One-way binding
▪ HTML inside JavaScript
▪ Components Only
▪ Bring only what you need
@bolshchikov
14
@bolshchikov
AGENDA
1. The state of front end now
2. React ecosystem
3. React: before and after
4. Design React application
5. React Syntax
1. Representational
components
2. Container components
6. Life-cycle management
7. Hand-on part
@bolshchikov 15
@bolshchikov
Designing
Application
04
@bolshchikov 16
@bolshchikov
Every application is
a tree of components
@bolshchikov 17
@bolshchikov 18
Parent
Component
Components Tree
@bolshchikov 19
Parent
Component
Child
Component
Child
Component
Child
Component
Components Tree
@bolshchikov 20
Parent
Component
Child
Component
Child
Component
Child
Component
Grandchild
Component
Grandchild
Component
Components Tree
@bolshchikov 21
Parent
Component
Child
Component
Child
Component
Child
Component
Grandchild
Component
Grandchild
Component
Grandchild
Component
Components Tree
@bolshchikov 22
@bolshchikov 23
TweetHeader
@bolshchikov 24
TweetHeader
Tweet Body
@bolshchikov 25
TweetHeader
Tweet Body
TweetSocial
@bolshchikov 26
TweetHeader
Tweet Body
TweetSocial
TweetTimestamp
TweetActions
@bolshchikov 27
TweetHeader
@bolshchikov
Your turn to try
Divide UI into components
@bolshchikov 28
@bolshchikov 29
@bolshchikov 30
@bolshchikov
There is one way
flow of data
@bolshchikov 31
@bolshchikov 32
Parent
Component
Child
Component
Child
Component
Child
Component
Grandchild
Component
Grandchild
Component
Grandchild
Component
Data Flow
@bolshchikov 33
Parent
Component
Child
Component
Data Flow
props
callbacks
@bolshchikov
AGENDA
1. The state of front end now
2. React ecosystem
3. React: before and after
4. Design React application
5. React Syntax
1. Representational
components
2. Container components
6. Life-cycle management
7. Hand-on part
@bolshchikov 34
@bolshchikov
React
Syntax
05
@bolshchikov 35
@bolshchikov
import React from 'react';
const MyComp = props => {
return (
<div>Hello World!</div>
);
}
export default MyComp;
React Stateless
Component
▪ Arrow function
▪ Accepts props object
▪ Returns JSX
Representational
Component
36
@bolshchikov
import {React} from 'react';
import PropTypes from 'prop-types';
const MyComp = ({ name }) => {
return (
<div>Hello, {name}</div>
);
}
MyComp.propTypes = {
name: PropTypes.string.isRequired
};
export default MyComp;
React Stateless
Component
▪ Import PropTypes
▪ Define propTypes
Representational
Component with
PropTypes
37
@bolshchikov
Your turn to try
Generate the app &
Create a representation component
@bolshchikov 38
@bolshchikov
import React, {Component} from 'react';
import PropTypes from 'prop-types';
class MyComp extends Component {
render() {
const name = {this.props};
return (
<div>Hello, {name}</div>
);
}
}
MyComp.propTypes = {
name: PropTypes.string.isRequired
};
export default MyComp;
React Stateless
Component
▪ Extends from
Component
▪ Has a render()
method
Form of ES6 class
39
@bolshchikov
import React, {Component} from 'react';
class MyComp extends Component {
constructor(props) {
super(props);
this.state = {name: 'Sergey'}
}
render() {
const name = this.state.name;
return (
<div>Hello, {name}</div>
);
}
}
export default MyComp;
React Stateful
Component
▪ set initial state
40
Set internal state
@bolshchikov
import React, {Component} from 'react';
class MyComp extends Component {
constructor(props) {
super(props);
this.state = {name: ''}
}
componentWillMount() {
fetch('/name').then(name => this.setState({name}));
}
render() {
const name = {this.state};
return (
<div>Hello, {name}</div>
);
}
}
export default MyComp;
React Stateful
Component
Set internal state
41
▪ component will
mount
▪ set internal state
@bolshchikov
React
Lifecycle
06
@bolshchikov 42
@bolshchikov
componentWillMount()
43
constructor(props) componentDidMount()
Mounting Mounted
render()
componentShouldU
pdate()
componentWillRec
eiveProps(nextPro
ps)
componentDidUp
date()
Receiving State Mounted
componentWillUpda
te()
componentWillUnmout()
Unmounting
render()
@bolshchikov
@bolshchikov
AGENDA
1. The state of front end now
2. React ecosystem
3. React: before and after
4. Design React application
5. React Syntax
1. Representational
components
2. Container components
6. Life-cycle management
7. Hand-on part
@bolshchikov 44
@bolshchikov
Hand-on
Part in Pairs
07
@bolshchikov 45
@bolshchikov
▪ Login
▪ Display list of users
▪ Chat with any user
▪ Receive messages
Simple WazzApp
46@bolshchikov
@bolshchikov 47
@bolshchikov 48
@bolshchikov 49
@bolshchikov 50
@bolshchikov
❏ Divide into pairs
❏ Implement every component
❏ Push to git
❏ Deploy
❏ Play together
Plan for today
51@bolshchikov
@bolshchikov
References
99
@bolshchikov 52
@bolshchikov@bolshchikov
1. Create React App
2. Understanding React
3. Frontend Ecosystem
4. Angular Two-way Binding
5. Pete Hunt: React: Rethinking best practices -- JSConf EU 2013
6. Pete Hunt: React: Rethinking best practices -- JSConf EU 2013 [Slides]
7. React: How To
8. WazzApp Repo
53
@bolshchikov
Thank You
linkedin/bolshchikov github.com/bolshchikov@bolshchikovsergeyb@wix.com
@bolshchikov
Q&A
linkedin/bolshchikov github.com/bolshchikov@bolshchikovsergeyb@wix.com
@bolshchikov
Feedback Form
linkedin/bolshchikov github.com/bolshchikov@bolshchikovsergeyb@wix.com

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (6)

Easy tests with Selenide and Easyb
Easy tests with Selenide and EasybEasy tests with Selenide and Easyb
Easy tests with Selenide and Easyb
 
Design functional solutions in Java, a practical example
Design functional solutions in Java, a practical exampleDesign functional solutions in Java, a practical example
Design functional solutions in Java, a practical example
 
DJango
DJangoDJango
DJango
 
Automation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and BeyondAutomation Abstractions: Page Objects and Beyond
Automation Abstractions: Page Objects and Beyond
 
Joget Workflow v5 Training Slides - Module 18 - Integrating with External System
Joget Workflow v5 Training Slides - Module 18 - Integrating with External SystemJoget Workflow v5 Training Slides - Module 18 - Integrating with External System
Joget Workflow v5 Training Slides - Module 18 - Integrating with External System
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 

Ähnlich wie Pragmatic React Workshop

Ähnlich wie Pragmatic React Workshop (20)

How to create components in react js
How to create components in react jsHow to create components in react js
How to create components in react js
 
Basic Tutorial of React for Programmers
Basic Tutorial of React for ProgrammersBasic Tutorial of React for Programmers
Basic Tutorial of React for Programmers
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
Build web apps with react js
Build web apps with react jsBuild web apps with react js
Build web apps with react js
 
React Nativeの光と闇
React Nativeの光と闇React Nativeの光と闇
React Nativeの光と闇
 
ReactJS for Programmers
ReactJS for ProgrammersReactJS for Programmers
ReactJS for Programmers
 
slides.pptx
slides.pptxslides.pptx
slides.pptx
 
slides.pptx
slides.pptxslides.pptx
slides.pptx
 
Fundamental concepts of react js
Fundamental concepts of react jsFundamental concepts of react js
Fundamental concepts of react js
 
Use React Patterns to Build Large Scalable App
Use React Patterns to Build Large Scalable App Use React Patterns to Build Large Scalable App
Use React Patterns to Build Large Scalable App
 
React mit TypeScript – eine glückliche Ehe
React mit TypeScript – eine glückliche EheReact mit TypeScript – eine glückliche Ehe
React mit TypeScript – eine glückliche Ehe
 
React JS: A Secret Preview
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
 
Introduction to React for Frontend Developers
Introduction to React for Frontend DevelopersIntroduction to React for Frontend Developers
Introduction to React for Frontend Developers
 
Enhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order componentEnhance react app with patterns - part 1: higher order component
Enhance react app with patterns - part 1: higher order component
 
Building user interface with react
Building user interface with reactBuilding user interface with react
Building user interface with react
 
Lessons from a year of building apps with React Native
Lessons from a year of building apps with React NativeLessons from a year of building apps with React Native
Lessons from a year of building apps with React Native
 
REACT pdf.docx
REACT pdf.docxREACT pdf.docx
REACT pdf.docx
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
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]
 
React Native custom components
React Native custom componentsReact Native custom components
React Native custom components
 

Mehr von Sergey Bolshchikov

Mehr von Sergey Bolshchikov (14)

Onboarding for Software Engineers Done Right
Onboarding for Software Engineers Done RightOnboarding for Software Engineers Done Right
Onboarding for Software Engineers Done Right
 
Microservices on the client side
Microservices on the client sideMicroservices on the client side
Microservices on the client side
 
ES2015 Quiz
ES2015 QuizES2015 Quiz
ES2015 Quiz
 
Talking code: How To
Talking code: How ToTalking code: How To
Talking code: How To
 
Values & Culture of Continuous Deliver
Values & Culture of Continuous DeliverValues & Culture of Continuous Deliver
Values & Culture of Continuous Deliver
 
Protractor: Tips & Tricks
Protractor: Tips & TricksProtractor: Tips & Tricks
Protractor: Tips & Tricks
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
 
Зачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQueryЗачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQuery
 
Ember Reusable Components and Widgets
Ember Reusable Components and WidgetsEmber Reusable Components and Widgets
Ember Reusable Components and Widgets
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
JS Single-Page Web App Essentials
JS Single-Page Web App EssentialsJS Single-Page Web App Essentials
JS Single-Page Web App Essentials
 

Kürzlich hochgeladen

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
Safe Software
 
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
Safe 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 business
panagenda
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Kürzlich hochgeladen (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
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
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Pragmatic React Workshop