Home / File/ ssr-infer-event-handlers-from-startTransition.js — react Source File

ssr-infer-event-handlers-from-startTransition.js — react Source File

Architecture documentation for ssr-infer-event-handlers-from-startTransition.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

// @enableOptimizeForSSR
function Component() {
  const [, startTransition] = useTransition();
  const [state, setState] = useState(0);
  const ref = useRef(null);
  const onChange = e => {
    // The known startTransition call allows us to infer this as an event handler
    // and prune it
    startTransition(() => {
      setState.call(null, e.target.value);
    });
  };
  useEffect(() => {
    log(ref.current.value);
  });
  return <CustomInput value={state} onChange={onChange} ref={ref} />;
}

Subdomains

Functions

Frequently Asked Questions

What does ssr-infer-event-handlers-from-startTransition.js do?
ssr-infer-event-handlers-from-startTransition.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-startTransition.js?
ssr-infer-event-handlers-from-startTransition.js defines 1 function(s): Component.
Where is ssr-infer-event-handlers-from-startTransition.js in the architecture?
ssr-infer-event-handlers-from-startTransition.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/ssr/ssr-infer-event-handlers-from-startTransition.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