计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
nextjs-state-management【效率与协作】Apply best practices for managing URL, server, and client state in Next.js applications. Use when choosing between URL params, SWR/TanStack Query, Zustand, or Context for state, or when fixing hydration mismatches from localStorage.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
useSearchParams + useRouter).useState.'use client' only) or Jotai.useState. Colocate as close to consumer as possible.Wrap localStorage reads in useEffect or mounted flag to avoid hydration mismatches. Manage optimistic updates with useOptimistic in Next.js 15+.
If project already uses redux@4 + createStore + redux-thunk + next-redux-wrapper:
useSelector / useDispatch hooks — never connect HOC.RootState and typed AppDispatch for all selectors and dispatch calls.@reduxjs/toolkit) → RTK Query → then consider TanStack Query.See references/redux.md for typed selector and thunk patterns.
useState or URL params; avoid Zustand for basic UI.useEffect for data fetching: Use SWR or TanStack Query for server state.