SlideShare uma empresa Scribd logo
1 de 56
Baixar para ler offline
@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

Mais conteúdo relacionado

Mais procurados

Mais procurados (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
 

Semelhante a Pragmatic React Workshop

Semelhante a 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
 

Mais de Sergey Bolshchikov

Mais de 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
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Pragmatic React Workshop