MeWrite Docs

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 NativeUnable to resolve moduleモジュール解決の失敗
RemixLoader threw errorLoader関数のエラー
shadcn/uiComponent not foundコンポーネント未インストール
SWRError fetching dataデータフェッチの失敗
TanStack QueryNo QueryClient setProvider の設定漏れ
ZustandStore 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
お探しの環境がありませんか?