useContext-read-context-in-callback.js — react Source File
Architecture documentation for useContext-read-context-in-callback.js, a javascript file in the react codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 0c92efec_9aa6_8882_08b8_43ad81b0b481["useContext-read-context-in-callback.js"] ac587885_e294_a1e9_b13f_5e7b920fdb42["react"] 0c92efec_9aa6_8882_08b8_43ad81b0b481 --> ac587885_e294_a1e9_b13f_5e7b920fdb42 style 0c92efec_9aa6_8882_08b8_43ad81b0b481 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import {createContext, useContext} from 'react';
const FooContext = createContext({current: null});
function Component(props) {
const foo = useContext(FooContext);
// This function should be memoized since it is only reading the context value
const onClick = () => {
console.log(foo.current);
};
return <div onClick={onClick}>{props.children}</div>;
}
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{children: <div>Hello</div>}],
};
Domain
Subdomains
Functions
Dependencies
- react
Source
Frequently Asked Questions
What does useContext-read-context-in-callback.js do?
useContext-read-context-in-callback.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 useContext-read-context-in-callback.js?
useContext-read-context-in-callback.js defines 1 function(s): Component.
What does useContext-read-context-in-callback.js depend on?
useContext-read-context-in-callback.js imports 1 module(s): react.
Where is useContext-read-context-in-callback.js in the architecture?
useContext-read-context-in-callback.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useContext-read-context-in-callback.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free