Home / Function/ WrapperTestComponent() — react Function Reference

WrapperTestComponent() — react Function Reference

Architecture documentation for the WrapperTestComponent() function in evaluator.ts from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  b55af0df_175a_b10d_f381_c6dca3d1fd0f["WrapperTestComponent()"]
  e04df78a_8312_1a6c_3ce1_ea408e44a1d7["evaluator.ts"]
  b55af0df_175a_b10d_f381_c6dca3d1fd0f -->|defined in| e04df78a_8312_1a6c_3ce1_ea408e44a1d7
  3c44ef67_7a19_657e_bba6_9d9cff25667a["toJSON()"]
  b55af0df_175a_b10d_f381_c6dca3d1fd0f -->|calls| 3c44ef67_7a19_657e_bba6_9d9cff25667a
  style b55af0df_175a_b10d_f381_c6dca3d1fd0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

compiler/packages/snap/src/sprout/evaluator.ts lines 114–124

function WrapperTestComponent(props: {fn: any; params: Array<any>}) {
  const result = props.fn(...props.params);
  // Hacky solution to determine whether the fixture returned jsx (which
  // needs to passed through to React's runtime as-is) or a non-jsx value
  // (which should be converted to a string).
  if (typeof result === 'object' && result != null && '$$typeof' in result) {
    return result;
  } else {
    return toJSON(result);
  }
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does WrapperTestComponent() do?
WrapperTestComponent() is a function in the react codebase, defined in compiler/packages/snap/src/sprout/evaluator.ts.
Where is WrapperTestComponent() defined?
WrapperTestComponent() is defined in compiler/packages/snap/src/sprout/evaluator.ts at line 114.
What does WrapperTestComponent() call?
WrapperTestComponent() calls 1 function(s): toJSON.

Analyze Your Own Codebase

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

Try Supermodel Free