SlideShare une entreprise Scribd logo
1  sur  37
Télécharger pour lire hors ligne
LESSON LEARNED
FROM ESCAPING
REACT.JS
Nanmanas Poonyapat (NnmnsP)
WHO AM I ?
Nanmanas
Poonyapat
June
github.com/NnmnsP
@NnmnsP
Nanmanas Poonyapat
สอวน.
COMPETITIVE
PROGRAMMING
Only one method can
solve it all?
BUT?
JavaScript Library
Component
State
Props
JSX
create-react-app
redux
WTF
Where is CSS
Where is HTML
I hate JavaScript
Hello
document เปนหลักเปนแหล่ง
และอ่านง่ายมากกก
Framework size ค่อนข้างเล็ก
Template ทีดี
DevTools ทีดี
เล่นได้หลายท่า
Ecosystem
ก็ครบ
. . .
ลองเล่นดูก็ได้
เริมจากอะไรดี
create-react-app
โอเค เจอปญหาล่ะ
Adjacent JSX elements must be
wrapped in an enclosing tag
<div>............</div>
<React.fragment>.........</React.fragment>
<>.......</>
Cannot call setState on undefined
Incorrect imports / exports
Including Redux too soon
เออ มันก็ไม่ได้แย่นีหว่า
อะไรทีเราควรระวังบ้าง
อย่าไป mutate shared state แบบตรงๆ ลองหาตัว
ช่วย เช่นใช้ shared store พวก Redux หรือใช้
Context
แยก actions ทีมี side effect ออกจากโค้ด state
management ด้วย
ใช้ immutable data structure: ทําแอพ ยังไง
global state ก็ต้องมีใช่มะ ใช้ Library พวก Immer
จะช่วยได้เยอะ
แล้วทําไมไม่พูดถึง
Angular
ใครใคร่ใช้ก็ใช้  อย่ามาตีกันเลยว่าอะไรดีกว่า

Contenu connexe

Plus de Seven Peaks Speaks

Plus de Seven Peaks Speaks (20)

Secure Development of Azure Function
Secure Development of Azure FunctionSecure Development of Azure Function
Secure Development of Azure Function
 
Develop Security & Compliances in Azure
Develop Security & Compliances in AzureDevelop Security & Compliances in Azure
Develop Security & Compliances in Azure
 
Effective Lists Management
Effective Lists ManagementEffective Lists Management
Effective Lists Management
 
Layout Preview Tooling
Layout Preview ToolingLayout Preview Tooling
Layout Preview Tooling
 
Background Processing With Work Manager
Background Processing With Work ManagerBackground Processing With Work Manager
Background Processing With Work Manager
 
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Graph ql vs rest api - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
 
Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
Structuring node.js projects - Seven Peaks Software (Node.JS Meetup 18 nov 2021)
 
Delivering react app with confidence: Testing Pyramid
Delivering react app with confidence: Testing PyramidDelivering react app with confidence: Testing Pyramid
Delivering react app with confidence: Testing Pyramid
 
React context
React context  React context
React context
 
Getting hooked on performance and clean code
Getting hooked on performance and clean codeGetting hooked on performance and clean code
Getting hooked on performance and clean code
 
Establishing secure Biometric authentication in Android
Establishing secure Biometric authentication in AndroidEstablishing secure Biometric authentication in Android
Establishing secure Biometric authentication in Android
 
Utilizing kotlin flows in an android application
Utilizing kotlin flows in an android applicationUtilizing kotlin flows in an android application
Utilizing kotlin flows in an android application
 
Continuously deploy a containerized app to “Azure App Service”
Continuously deploy a containerized app to “Azure App Service”Continuously deploy a containerized app to “Azure App Service”
Continuously deploy a containerized app to “Azure App Service”
 
Static web apps by GitHub action
Static web apps by GitHub actionStatic web apps by GitHub action
Static web apps by GitHub action
 
Developers Guide to Cosmos DB
Developers Guide to Cosmos DBDevelopers Guide to Cosmos DB
Developers Guide to Cosmos DB
 
Seven Peaks Speaks: Accessibility for iOS, Android and Web
Seven Peaks Speaks: Accessibility for iOS, Android and WebSeven Peaks Speaks: Accessibility for iOS, Android and Web
Seven Peaks Speaks: Accessibility for iOS, Android and Web
 
Seven Peaks Speaks: User testing to action
Seven Peaks Speaks: User testing to actionSeven Peaks Speaks: User testing to action
Seven Peaks Speaks: User testing to action
 
Serverless Architecture in Azure and AWS
Serverless Architecture in Azure and AWSServerless Architecture in Azure and AWS
Serverless Architecture in Azure and AWS
 
Automated Testing ชีวิตดีๆที่ลงตัว (design + tech stack)
Automated Testing ชีวิตดีๆที่ลงตัว (design + tech stack)Automated Testing ชีวิตดีๆที่ลงตัว (design + tech stack)
Automated Testing ชีวิตดีๆที่ลงตัว (design + tech stack)
 
iOS Architecture Breakdown Meetup
iOS Architecture Breakdown MeetupiOS Architecture Breakdown Meetup
iOS Architecture Breakdown Meetup
 

Lesson learned from escaping React.js