【React】React Queryの基礎知識をまとめました(Stale, Cache, Prefetchingなど)フロントエンドReact状態管理react-query はじめに 新しい現場ではReactの状態管理にReduxを使っているのですが、Action CreatorやReducerなど、コード量の多さに辟易してしまうことがしばしばあります。 そんな悩みを解決する状態管理ライブラリとしてReact Queryが流行っているらしいので、このたび勉強してみることにしました。 以前書いた状態管理の記事もあわせてご覧いただければ幸いです。 React Queryとは React Queryの大きな特徴として、サーバから取得したデータをクライアントでキャッシュとして保管できることが挙げられます。 また、新しいデータを取得したときにいつキャッシュを更新するか、なども管理することができます。