useCallback-nonescaping.js — react Source File
Architecture documentation for useCallback-nonescaping.js, a javascript file in the react codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR af07d635_81db_219a_5341_2c5c6aa5321f["useCallback-nonescaping.js"] ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] af07d635_81db_219a_5341_2c5c6aa5321f --> ac587885_e294_a1e9_b13f_5e7b920fdb42 style af07d635_81db_219a_5341_2c5c6aa5321f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
// @validatePreserveExistingMemoizationGuarantees @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions
import {useCallback} from 'react';
function Component({entity, children}) {
// showMessage doesn't escape so we don't memoize it.
// However, validatePreserveExistingMemoizationGuarantees only sees that the scope
// doesn't exist, and thinks the memoization was missed instead of being intentionally dropped.
const showMessage = useCallback(() => entity != null, [entity]);
if (!showMessage()) {
return children;
}
return <div>{children}</div>;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [
{
entity: {name: 'Sathya'},
children: [<div key="gsathya">Hi Sathya!</div>],
},
],
};
Domain
Subdomains
Functions
Dependencies
- react
Source
Frequently Asked Questions
What does useCallback-nonescaping.js do?
useCallback-nonescaping.js is a source file in the react codebase, written in javascript. It belongs to the TestingUtilities domain, Fixtures subdomain.
What functions are defined in useCallback-nonescaping.js?
useCallback-nonescaping.js defines 1 function(s): Component.
What does useCallback-nonescaping.js depend on?
useCallback-nonescaping.js imports 1 module(s): react.
Where is useCallback-nonescaping.js in the architecture?
useCallback-nonescaping.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation/useCallback-nonescaping.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/preserve-memo-validation).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free