SlideShare a Scribd company logo
React stack
@Lozi
lozi.vn
The front-end heaven
- New libraries everyday
- Project gets old after a few months
- You quickly become old-fashioned man/woman
2
The front-end heaven
- New libraries everyday
- Project gets old after a few months
- You quickly become old-fashioned man/woman
=> https://uptodate.frontendrescue.org/
3
React stack @Lozi
1. Isomorphic App
2. Trinity Force: React, React Router & Redux
3. Self-aware Component
4
by Thinh Nguyen Cuong - cuongthinh@lozi.vn
Web Developer at Lozi.vn
1. Isomorphic App
5
"Isomorphism is the functional aspect of
seamlessly switching between client- and
server-side rendering without losing state."
Source: https://reactjsnews.com/isomorphic-react-in-real-life
Concept
"Universal is a term used to emphasize the fact
that a particular piece of JavaScript code is
able to run in multiple environments."
@ghengeveld on Medium
1. Isomorphic App
6
Server-side Client-side
The kind-of Isomorphic React App
1. Isomorphic App
7
Source: https://reactjsnews.com/isomorphic-react-in-real-life
Concept Real life
8
Flummox: Nice and friendly and do-whatever-you-want Flux
⇒ Anti-pattern: “Cannot dispatch in a middle of a dispatch” a.k.a. Hard to make side effects
⇒ Hard to debug: data comes from nowhere
⇒ Took a lot of time to get on with the project, then to add new features
.
.
.
Life at Lozi before web v3.0
2. Trinity Force: React-React Router-Redux
9
React & React Router: API changes on each release, which
encourages you to build a new app, rather than upgrade the old one
2. Trinity Force: React-React Router-Redux
10
TONS OF
DAMAGE!!
React & React Router: API changes on each release, which
encourages you to build a new app, rather than upgrade the old one
Redux: Keeps you on the right track!
⇒ Completely “predictable”
⇒ Hot reloading & Time travel with Redux Devtool
⇒ Flummox’s creator (@acdlite) recommends Redux
2. Trinity Force: React-React Router-Redux
11
Source: http://slides.com/jenyaterpil/redux-from-twitter-hype-to-production
3. Self-aware Component?
12
Repeating this all the time
3. Self-aware Component?
A component that:
- Is a base component to be extended
- Can check if it has data in store
- Can fetch data from api on its own
- Decide to render itself, based on data status in store
13
3. Self-aware Component
The base class injects code into the overridden method from the subclass, to do additional tasks.
14
3. Self-aware Component
The base class injects code into the overridden method from the subclass, to do additional tasks.
15
3. Self-aware Component
The base class injects code into the overridden method from the subclass, to do additional tasks.
16
The same with componentDidUpdate()
3. Self-aware Component
Self-aware Component required props:
- actionCreator(): Redux’s action object, API is fetched here
- dataGetter(): used in Redux’s connect() to get the specific data from the store
- params: used as params for actionCreator & dataGetter
17
3. Self-aware Component
But first, the component needs to be wrapped by Redux’s connect() so it can access the data.
18
A custom mapStateToProps() will execute dataGetter() to get the data for the component

More Related Content

PDF
Grokking TechTalk #24: Kafka's principles and protocols
PPSX
Apache kafka introduction
PPT
Kafka goutam chowdhury-unicom-spark kafka-summit
PPTX
Kafka 101
PPTX
Kafka Summit NYC 2017 - Deep Dive Into Apache Kafka
PDF
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Field
ODP
Introduction to Apache Kafka- Part 1
PDF
Kafka Overview
Grokking TechTalk #24: Kafka's principles and protocols
Apache kafka introduction
Kafka goutam chowdhury-unicom-spark kafka-summit
Kafka 101
Kafka Summit NYC 2017 - Deep Dive Into Apache Kafka
Kafka Summit SF 2017 - Kafka Connect Best Practices – Advice from the Field
Introduction to Apache Kafka- Part 1
Kafka Overview

What's hot (20)

PDF
Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019
PPTX
Kafka Connect
PPTX
Introduction to Apache Kafka
PDF
Kafka 101 - Meetup Kafka BR - Oracle
PPTX
Confluent building a real-time streaming platform using kafka streams and k...
PPTX
APACHE KAFKA / Kafka Connect / Kafka Streams
PDF
Kafka internals
PPTX
Kafka blr-meetup-presentation - Kafka internals
PPTX
Apache Kafka
PDF
Fundamentals of Apache Kafka
PPTX
Kube 101
PDF
How Splunk Is Using Pulsar IO
PPTX
Kafka 101
PDF
Introduction to apache kafka
ODP
Stream processing using Kafka
PPTX
stigbot_beta
PDF
Apache Kafka Architecture & Fundamentals Explained
PPT
Building Linux IPv6 DNS Server (Third Review)
PDF
Until Successful Scope With Mule ESB
PPTX
Apache Kafka
Please Upgrade Apache Kafka. Now. (Gwen Shapira, Confluent) Kafka Summit SF 2019
Kafka Connect
Introduction to Apache Kafka
Kafka 101 - Meetup Kafka BR - Oracle
Confluent building a real-time streaming platform using kafka streams and k...
APACHE KAFKA / Kafka Connect / Kafka Streams
Kafka internals
Kafka blr-meetup-presentation - Kafka internals
Apache Kafka
Fundamentals of Apache Kafka
Kube 101
How Splunk Is Using Pulsar IO
Kafka 101
Introduction to apache kafka
Stream processing using Kafka
stigbot_beta
Apache Kafka Architecture & Fundamentals Explained
Building Linux IPv6 DNS Server (Third Review)
Until Successful Scope With Mule ESB
Apache Kafka
Ad

Viewers also liked (13)

PPTX
Grokking TechTalk #16: F**k bad CSS
PPTX
Grokking TechTalk #16: Maybe functor in javascript
PPTX
Grokking TechTalk #16: Html js and three way binding
PDF
Grokking: Data Engineering Course
PDF
TechTalk #15 Grokking: The data processing journey at AhaMove
PDF
Responsive emails and ZURB Foundation for email
PDF
TDC São Paulo - React presentation
PPTX
Hotel Vermont and Community Entrepreneurship (v2)
PPTX
La Familia
PPTX
Energias no renovables
PDF
10 Weird Bans Around The World
PDF
Employee advocacy - guide opérationnel
PDF
Breaking the Server-Client Divide with Node.js and React
Grokking TechTalk #16: F**k bad CSS
Grokking TechTalk #16: Maybe functor in javascript
Grokking TechTalk #16: Html js and three way binding
Grokking: Data Engineering Course
TechTalk #15 Grokking: The data processing journey at AhaMove
Responsive emails and ZURB Foundation for email
TDC São Paulo - React presentation
Hotel Vermont and Community Entrepreneurship (v2)
La Familia
Energias no renovables
10 Weird Bans Around The World
Employee advocacy - guide opérationnel
Breaking the Server-Client Divide with Node.js and React
Ad

Similar to Grokking TechTalk #16: React stack at lozi (20)

PDF
An Intense Overview of the React Ecosystem
PPTX
React js
PDF
FRONTEND DEVELOPMENT WITH REACT.JS
PDF
An Overview of the React Ecosystem
PPTX
Better web apps with React and Redux
PDF
Tech Talk on ReactJS
PPTX
React + Flux = Joy
PPTX
React.js at Cortex
PPSX
React introduction
PDF
The Road To Redux
PDF
JOSA TechTalks - Better Web Apps with React and Redux
PDF
React JS and why it's awesome
PDF
React & Flux Workshop
PDF
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
PDF
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
PDF
Introduction to React JS
PDF
React - The JavaScript Library for User Interfaces
PPTX
React & redux
PPTX
theory-slides-for react for beginners.pptx
PPTX
An Intense Overview of the React Ecosystem
React js
FRONTEND DEVELOPMENT WITH REACT.JS
An Overview of the React Ecosystem
Better web apps with React and Redux
Tech Talk on ReactJS
React + Flux = Joy
React.js at Cortex
React introduction
The Road To Redux
JOSA TechTalks - Better Web Apps with React and Redux
React JS and why it's awesome
React & Flux Workshop
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
Introduction to React JS
React - The JavaScript Library for User Interfaces
React & redux
theory-slides-for react for beginners.pptx

More from Grokking VN (20)

PDF
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
PDF
Grokking Techtalk #45: First Principles Thinking
PDF
Grokking Techtalk #42: Engineering challenges on building data platform for M...
PDF
Grokking Techtalk #43: Payment gateway demystified
PPTX
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
PPTX
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
PDF
Grokking Techtalk #39: Gossip protocol and applications
PDF
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
PDF
Grokking Techtalk #38: Escape Analysis in Go compiler
PPTX
Grokking Techtalk #37: Data intensive problem
PPTX
Grokking Techtalk #37: Software design and refactoring
PDF
Grokking TechTalk #35: Efficient spellchecking
PDF
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
PDF
Grokking TechTalk #33: High Concurrency Architecture at TIKI
PDF
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
PDF
SOLID & Design Patterns
PDF
Grokking TechTalk #31: Asynchronous Communications
PDF
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
PDF
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
PDF
Grokking TechTalk #27: Optimal Binary Search Tree
Grokking Techtalk #46: Lessons from years hacking and defending Vietnamese banks
Grokking Techtalk #45: First Principles Thinking
Grokking Techtalk #42: Engineering challenges on building data platform for M...
Grokking Techtalk #43: Payment gateway demystified
Grokking Techtalk #40: Consistency and Availability tradeoff in database cluster
Grokking Techtalk #40: AWS’s philosophy on designing MLOps platform
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: How to build an event driven architecture with Kafka ...
Grokking Techtalk #38: Escape Analysis in Go compiler
Grokking Techtalk #37: Data intensive problem
Grokking Techtalk #37: Software design and refactoring
Grokking TechTalk #35: Efficient spellchecking
Grokking Techtalk #34: K8S On-premise: Incident & Lesson Learned ZaloPay Mer...
Grokking TechTalk #33: High Concurrency Architecture at TIKI
Grokking TechTalk #33: Architecture of AI-First Systems - Engineering for Big...
SOLID & Design Patterns
Grokking TechTalk #31: Asynchronous Communications
Grokking TechTalk #30: From App to Ecosystem: Lessons Learned at Scale
Grokking TechTalk #29: Building Realtime Metrics Platform at LinkedIn
Grokking TechTalk #27: Optimal Binary Search Tree

Recently uploaded (20)

PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PPT
Teaching material agriculture food technology
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
20250228 LYD VKU AI Blended-Learning.pptx
Building Integrated photovoltaic BIPV_UPV.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
sap open course for s4hana steps from ECC to s4
Teaching material agriculture food technology
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Per capita expenditure prediction using model stacking based on satellite ima...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Dropbox Q2 2025 Financial Results & Investor Presentation
Review of recent advances in non-invasive hemoglobin estimation
MIND Revenue Release Quarter 2 2025 Press Release
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Grokking TechTalk #16: React stack at lozi

  • 2. The front-end heaven - New libraries everyday - Project gets old after a few months - You quickly become old-fashioned man/woman 2
  • 3. The front-end heaven - New libraries everyday - Project gets old after a few months - You quickly become old-fashioned man/woman => https://uptodate.frontendrescue.org/ 3
  • 4. React stack @Lozi 1. Isomorphic App 2. Trinity Force: React, React Router & Redux 3. Self-aware Component 4 by Thinh Nguyen Cuong - cuongthinh@lozi.vn Web Developer at Lozi.vn
  • 5. 1. Isomorphic App 5 "Isomorphism is the functional aspect of seamlessly switching between client- and server-side rendering without losing state." Source: https://reactjsnews.com/isomorphic-react-in-real-life Concept "Universal is a term used to emphasize the fact that a particular piece of JavaScript code is able to run in multiple environments." @ghengeveld on Medium
  • 6. 1. Isomorphic App 6 Server-side Client-side The kind-of Isomorphic React App
  • 7. 1. Isomorphic App 7 Source: https://reactjsnews.com/isomorphic-react-in-real-life Concept Real life
  • 8. 8 Flummox: Nice and friendly and do-whatever-you-want Flux ⇒ Anti-pattern: “Cannot dispatch in a middle of a dispatch” a.k.a. Hard to make side effects ⇒ Hard to debug: data comes from nowhere ⇒ Took a lot of time to get on with the project, then to add new features . . . Life at Lozi before web v3.0
  • 9. 2. Trinity Force: React-React Router-Redux 9 React & React Router: API changes on each release, which encourages you to build a new app, rather than upgrade the old one
  • 10. 2. Trinity Force: React-React Router-Redux 10 TONS OF DAMAGE!! React & React Router: API changes on each release, which encourages you to build a new app, rather than upgrade the old one Redux: Keeps you on the right track! ⇒ Completely “predictable” ⇒ Hot reloading & Time travel with Redux Devtool ⇒ Flummox’s creator (@acdlite) recommends Redux
  • 11. 2. Trinity Force: React-React Router-Redux 11 Source: http://slides.com/jenyaterpil/redux-from-twitter-hype-to-production
  • 13. 3. Self-aware Component? A component that: - Is a base component to be extended - Can check if it has data in store - Can fetch data from api on its own - Decide to render itself, based on data status in store 13
  • 14. 3. Self-aware Component The base class injects code into the overridden method from the subclass, to do additional tasks. 14
  • 15. 3. Self-aware Component The base class injects code into the overridden method from the subclass, to do additional tasks. 15
  • 16. 3. Self-aware Component The base class injects code into the overridden method from the subclass, to do additional tasks. 16 The same with componentDidUpdate()
  • 17. 3. Self-aware Component Self-aware Component required props: - actionCreator(): Redux’s action object, API is fetched here - dataGetter(): used in Redux’s connect() to get the specific data from the store - params: used as params for actionCreator & dataGetter 17
  • 18. 3. Self-aware Component But first, the component needs to be wrapped by Redux’s connect() so it can access the data. 18 A custom mapStateToProps() will execute dataGetter() to get the data for the component