Component() — react Function Reference
Architecture documentation for the Component() function in ssr-infer-event-handlers-from-setState.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 992b51ee_f72e_3257_da84_25ab96067d37["Component()"] 40543028_6cb3_8687_930a_ef24cc2e4ad9["ssr-infer-event-handlers-from-setState.js"] 992b51ee_f72e_3257_da84_25ab96067d37 -->|defined in| 40543028_6cb3_8687_930a_ef24cc2e4ad9 style 992b51ee_f72e_3257_da84_25ab96067d37 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssr/ssr-infer-event-handlers-from-setState.js lines 2–14
function Component() {
const [state, setState] = useState(0);
const ref = useRef(null);
const onChange = e => {
// The known setState call allows us to infer this as an event handler
// and prune it
setState(e.target.value);
};
useEffect(() => {
log(ref.current.value);
});
return <CustomInput value={state} onChange={onChange} ref={ref} />;
}
Domain
Subdomains
Source
Frequently Asked Questions
What does Component() do?
Component() is a function in the react codebase, defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssr/ssr-infer-event-handlers-from-setState.js.
Where is Component() defined?
Component() is defined in compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssr/ssr-infer-event-handlers-from-setState.js at line 2.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free