SlideShare a Scribd company logo
Let’s develop app with react and recoil
Reactで話題のRecoilを使ってみた
フロントエンドLT会 vol.1 -2020夏祭り-
第6回 Try English LT! for engineers
Mikihiro Saito
Introduction
Mikihiro Saito
Software Engineer sa Philippines
JS(React、Vue、Angular)
Twitter: @bohol_engineer
What is React?
A JavaScript library for building user interfaces
- Declarative
- Component-Based
- Learn Once, Write Anywhere
How to write?
What is Recoil?
A state management library for React
- Minimal and Reactish
- Data-Flow Graph
- Cross-App Observation
State Management
user.name name
name
name
name
name
name
root component
child components
Why not use Redux?
- global state management library
- flux
- testable
State
Action
Dispacher
View
Disadvantage of Redux
- a lot of steps to make extra code
- Hooks
- Context API
Why not use Context API?
It’s not optimized for high-frequency updates
Anti-Pettern
How about
useReducer with
Context API?
re-rendering
problem
How about useReducer with Context
API?
It will face re-rendering problem.
Recoil
Core API
- Atoms
- Selectors
Atoms
Selectors
Asynchronous processing
- Redux Thunk
- Redux Saga
with Redux
With Recoil
Atom Family
selectorFamily
Other API
- useRecoilValueLoadable
- useRecoilCallback
- useRecoilSnapshot
.etc
React
- useRecoilValueLoadable
- useRecoilCallback
- useRecoilSnapshot
.etc
Architecture
ViewAtoms
Recoil
Selectors
API
DB
Server
Front
Repository Hooks Logic
How to test?
Directory
PJ Pages
Components
Recoil
hooks
Atoms
Selectors
hooks
Summary
- easy
- simple
- minimum
Thank you!

More Related Content

Reactで話題のRecoilを使ってみた