0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Next.js】状態管理ライブラリについて

Posted at

Next.jsにおいての状態管理

Next.jsでの状態管理は大きくわけて2つ。
useStateを利用するローカルな状態管理とグローバルな状態管理。

useStateはコンポーネント単位で状態を管理してコンポーネントが破棄されると管理していたStateもすべてクリアされる。

一方でグローバルな状態管理はアプリ全体で状態を管理するためコンポーネントに依存しない。
ユーザーのログイン情報などアプリで共有したい情報を扱う時に使う。

グローバルな状態管理で有名なライブラリはRedux。
他にも下記のようなライブラリがある。

  • Recoil
  • Zustand
  • Jotai
  • Valtio
  • Nano stores
  • Hookstate
  • Elf
  • Rematch

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?