MCPcopy
hub / github.com/facebook/react / useLayoutEffect

Function useLayoutEffect

packages/react/src/ReactHooks.js:119–133  ·  view source on GitHub ↗
(
  create: () => (() => void) | void,
  deps: Array<mixed> | void | null,
)

Source from the content-addressed store, hash-verified

117}
118
119export function useLayoutEffect(
120 create: () => (() => void) | void,
121 deps: Array<mixed> | void | null,
122): void {
123 if (__DEV__) {
124 if (create == null) {
125 console.warn(
126 'React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?',
127 );
128 }
129 }
130
131 const dispatcher = resolveDispatcher();
132 return dispatcher.useLayoutEffect(create, deps);
133}
134
135export function useCallback<T>(
136 callback: T,

Callers 10

ComponentFunction · 0.90
ComponentFunction · 0.90
TooltipFunction · 0.90
AppFunction · 0.90
Page.jsFile · 0.90
lazyLegacyRoot.jsFile · 0.90
Child1Function · 0.50
AppFunction · 0.50

Calls 1

resolveDispatcherFunction · 0.70

Tested by 4

ComponentFunction · 0.72
ComponentFunction · 0.72
TooltipFunction · 0.72
Child1Function · 0.40