Reactエラー
16件の記事
概要
React およびエコシステム(Remix, shadcn/ui, SWR, TanStack Query, Zustand)で発生するエラーの診断ガイドです。
どこでエラーが出た?
| 状況 | エラー | 主な原因 |
|---|---|---|
| Hooks ルール違反 | Hook is called conditionally | 条件分岐・ループ内でのHook呼び出し |
| Invalid hook call | コンポーネント外でのHook使用 | |
| useEffect has a missing dependency | 依存配列の不足 | |
| State が更新されない | state not updating | 直接変更・非同期の罠 |
| Cannot read property ‘setState’ | this バインドの問題 | |
| Too many re-renders | 無限レンダリングループ | |
| レンダリングエラー | Objects are not valid as a React child | オブジェクトの直接レンダリング |
| Each child should have a unique ‘key’ prop | リストの key 未設定 | |
| Cannot read properties of undefined | 未定義プロパティへのアクセス | |
| フォーム | React Hook Form validation not working | バリデーション設定の誤り |
| React Native | Unable to resolve module | モジュール解決の失敗 |
| Remix | Loader threw error | Loader関数のエラー |
| shadcn/ui | Component not found | コンポーネント未インストール |
| SWR | Error fetching data | データフェッチの失敗 |
| TanStack Query | No QueryClient set | Provider の設定漏れ |
| Zustand | Store state not updating | セレクタ・イミュータビリティ |
切り分けフローチャート
Reactエラー発生
├── Hooks関連のエラー?
│ ├── "Rules of Hooks" → hooks-rules-violation
│ ├── "Invalid hook call" → invalid-hook-call
│ └── "missing dependency" → useeffect-dependency
├── Stateが更新されない?
│ ├── setState / useState → state-not-updating / setstate-undefined
│ └── 無限ループ → too-many-rerenders
├── レンダリングでエラー?
│ ├── "Objects are not valid" → objects-not-valid-as-child
│ ├── "unique key prop" → unique-key-prop
│ └── "Cannot read properties" → cannot-read-properties-of-undefined
└── ライブラリ固有?
├── React Hook Form → hook-form-validation-error
├── Remix → remix-loader-error
├── shadcn/ui → shadcn-component-not-found
├── SWR → swr-error
├── TanStack Query → tanstack-query-invalid-hook-call
└── Zustand → zustand-store-not-updating
Hooks関連?
State更新?
レンダリング?
ライブラリ固有?
お探しの環境がありませんか?
全記事一覧
- No QueryClient set, use QueryClientProvider to set one
- Objects are not valid as a React child
- React Hook Form validation not working
- React Hook is called conditionally or in a loop
- React Hook useEffect has a missing dependency
- React state not updating
- React: Cannot read properties of undefined
- React: Invalid hook call
- Remix: Loader threw error
- shadcn/ui: Component not found
- Too many re-renders
- TypeError: Cannot read property 'setState' of undefined
- Unable to resolve module
- useSWR: Error fetching data
- Warning: Each child in a list should have a unique 'key' prop
- Zustand store state not updating in component
この記事は役に立ちましたか?