React Hook React.useCallback is called conditionally. React Hooks must be called in the exact same order in every component render
What causes it and how to fix it:
- rules-of-hooks false-positive — a complex JSX && chain flags the wrong hookA complex conditional in your render blames the wrong hook; extract it to a const. Second trigger: sheer component size — there extracting conditions doesn't help, splitting the component does. Third trigger: the recommended const extraction ITSELF — only block-by-block bisection from a clean HEAD finds the guilty lineCause and fix →