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
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
1
220
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
10
4.4k
駆け出しSREが半年で作り上げた仕組みと学びのまとめ
shogo4131
0
450
フロントエンド UIコンポーネント Shadcn/uiの良さを伝えたい!
shogo4131
0
330
本業 + 副業2社で働くエンジニアの時間術
shogo4131
0
320
スタートアップで学ぶフルリモート開発の進め方
shogo4131
0
660
フリーランスエンジニア辞めてみた!
shogo4131
0
730
MUIは不要? React次世代コンポーネントライブラリ Mantine!!!
shogo4131
0
260
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
55
8.4k
Optimizing for Happiness
mojombo
378
71k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
590
Balancing Empowerment & Direction
lara
6
1.3k
Mind Mapping
helmedeiros
1
390
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Building Applications with DynamoDB
mza
96
7.2k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
The Curse of the Amulet
leimatthew05
3
15k
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
ご静聴ありがとうございました!!