Home / Function/ useMakeCallback() — react Function Reference

useMakeCallback() — react Function Reference

Architecture documentation for the useMakeCallback() function in function-with-conditional-callsite-in-another-function.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  3c038a74_2edd_81ca_4127_9995fbdab785["useMakeCallback()"]
  553b839c_05ff_97a6_8f76_7a273364819c["function-with-conditional-callsite-in-another-function.ts"]
  3c038a74_2edd_81ca_4127_9995fbdab785 -->|defined in| 553b839c_05ff_97a6_8f76_7a273364819c
  20a66d60_f7b5_a082_04d9_08dbbb64fe0a["setState()"]
  3c038a74_2edd_81ca_4127_9995fbdab785 -->|calls| 20a66d60_f7b5_a082_04d9_08dbbb64fe0a
  style 3c038a74_2edd_81ca_4127_9995fbdab785 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-function/nullable-objects/assume-invoked/function-with-conditional-callsite-in-another-function.ts lines 26–38

function useMakeCallback({
  obj,
  cond,
  setState,
}: {
  obj: {value: number};
  cond: boolean;
  setState: (newState: number) => void;
}) {
  const cb = () => setState(obj.value);
  // cb's property loads are assumed to be hoistable to the start of this lambda
  return () => (cond ? cb() : undefined);
}

Subdomains

Calls

Frequently Asked Questions

What does useMakeCallback() do?
useMakeCallback() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-function/nullable-objects/assume-invoked/function-with-conditional-callsite-in-another-function.ts.
Where is useMakeCallback() defined?
useMakeCallback() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/inner-function/nullable-objects/assume-invoked/function-with-conditional-callsite-in-another-function.ts at line 26.
What does useMakeCallback() call?
useMakeCallback() calls 1 function(s): setState.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free