Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Jotaiをプロジェクトに導入してみた
Search
Shogo Fukami
December 10, 2022
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jotaiをプロジェクトに導入してみた
Shogo Fukami
December 10, 2022
More Decks by Shogo Fukami
See All by Shogo Fukami
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
10
4.2k
駆け出しSREが半年で作り上げた仕組みと学びのまとめ
shogo4131
0
420
フロントエンド UIコンポーネント Shadcn/uiの良さを伝えたい!
shogo4131
0
330
本業 + 副業2社で働くエンジニアの時間術
shogo4131
0
300
スタートアップで学ぶフルリモート開発の進め方
shogo4131
0
650
フリーランスエンジニア辞めてみた!
shogo4131
0
730
MUIは不要? React次世代コンポーネントライブラリ Mantine!!!
shogo4131
0
240
Featured
See All Featured
Everyday Curiosity
cassininazir
0
320
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1k
The Curious Case for Waylosing
cassininazir
1
510
Practical Orchestrator
shlominoach
192
12k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
GitHub's CSS Performance
jonrohan
1033
470k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Evolving SEO for Evolving Search Engines
ryanjones
0
290
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
58k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
520
Transcript
Jotaiをプロジェクトに導 入してみた @react_nextjs 2022/12/10
自己紹介 ・フロントエンドエンジニア(フリーランス) ・経験2年8ヶ月 ・React Next.js TypeScript ・大手決済サービスのフロントエンド開発 ・技術ブログ(https://react-uncle-blog.netlify.app/) ・Twitter(https://twitter.com/react_nextjs)
アジェンダ ・Jotaiってなに? ・プロジェクトに導入した経緯 ・サンプルソースの紹介
皆さん!! Jotaiって知ってますか??
Reactの状態管理ライブラリです!! 公式: https://jotai.org/
JavaScript Rising Starsで堂々の3位 参考: JavaScript Rising Stars 2021
詳しくは技術ブログで!! Reactの状態管理ライブラリを比較してベストな選択肢をしよう!
なぜプロジェクトで導入したのか?
要件 ・複数のページ間で保持しないといけない値が多かっ た ・グローバルで管理する状態を永続的に管理しないと いけなかった
その他候補に上がった状態管理ライブラリ ・Recoil ・Zustand 候補には上がりましたが、次の理由で選定から外しました。
• Recoil ◦ 正式リリースじゃないので破壊的変更がくる可能性があった ◦ パッケージサイズがやたらと重い(2.2MBくらい) ◦ 永続化するにはrecoil-persistというライブラリを別で導入しない といけない •
Zustand ◦ Reduxよりは簡潔に記述できるが、プロジェクトが始まった当初、 他メンバーのスキル感があまり高くなかったので学習コストがか かると感じた
消去法ではあったがJotaiに決まった ・学習コストがとても低く、React HooksのuseStateのように状態管理が できるので最低限のReactの知識があれば問題ないと感じた ・Recoilは状態の永続化をするのに別ライブラリを導入しないといけな かったが、Jotaiであれば標準搭載しているAPIがあるのでライブラリを 導入する必要がなかった ・作者が日本人なので日本語の情報が豊富
Jotaiのコードを簡単に紹介!!
None
None
ご静聴ありがとうございました!!