MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / assertCanCreateHook

Function assertCanCreateHook

packages/core/src/runtime/instances.ts:361–367  ·  view source on GitHub ↗
(index: number, kind: HookState["kind"])

Source from the content-addressed store, hash-verified

359 const mutableState = state as MutableInstanceState;
360
361 function assertCanCreateHook(index: number, kind: HookState["kind"]): void {
362 if (mutableState.expectedHookCount !== null && index >= mutableState.expectedHookCount) {
363 throw new Error(
364 `Hook count mismatch at index ${index}: rendered more hooks than previous render while reading ${kind}`,
365 );
366 }
367 }
368
369 function getHookIndex(): number {
370 const index = mutableState.hookIndex;

Callers 6

useStateFunction · 0.85
useReducerFunction · 0.85
useRefFunction · 0.85
useEffectFunction · 0.85
useMemoFunction · 0.85
useCallbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected