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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shogo Fukami
December 10, 2022
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Jotaiをプロジェクトに導入してみた
Shogo Fukami
December 10, 2022
Transcript
16 slides
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
ご静聴ありがとうございました!!
More Decks by Shogo Fukami
See All by Shogo Fukami
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
2k
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
10
4.5k
駆け出しSREが半年で作り上げた仕組みと学びのまとめ
shogo4131
0
490
フロントエンド UIコンポーネント Shadcn/uiの良さを伝えたい!
shogo4131
0
340
本業 + 副業2社で働くエンジニアの時間術
shogo4131
0
330
スタートアップで学ぶフルリモート開発の進め方
shogo4131
0
670
フリーランスエンジニア辞めてみた!
shogo4131
0
740
MUIは不要? React次世代コンポーネントライブラリ Mantine!!!
shogo4131
0
280
Featured
See All Featured
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
640
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.8k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
How to build a perfect <img>
jonoalderson
1
6.2k
Discover your Explorer Soul
emna__ayadi
2
1.3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
450
A better future with KSS
kneath
240
18k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
610
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
490