Ordinary Hooks must be called in a stable order at the top level of a function component or custom Hook, so React can match calls to state. A custom Hook shares stateful logic, not the state of separate calls. React’s special use API has different call-order rules.
Follow-up Interview Question · How would you move a condition into an effect without conditionally calling the hook?