ssr-infer-event-handlers-from-setState.js — react Source File
Architecture documentation for ssr-infer-event-handlers-from-setState.js, a javascript file in the react codebase.
Entity Profile
Relationship Graph
Source Code
// @enableOptimizeForSSR
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
Functions
Source
Frequently Asked Questions
What does ssr-infer-event-handlers-from-setState.js do?
ssr-infer-event-handlers-from-setState.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 ssr-infer-event-handlers-from-setState.js?
ssr-infer-event-handlers-from-setState.js defines 1 function(s): Component.
Where is ssr-infer-event-handlers-from-setState.js in the architecture?
ssr-infer-event-handlers-from-setState.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssr/ssr-infer-event-handlers-from-setState.js (domain: TestingUtilities, subdomain: Fixtures, directory: compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssr).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free