Home / File/ hoisting-setstate-captured-indirectly-jsx.js — react Source File

hoisting-setstate-captured-indirectly-jsx.js — react Source File

Architecture documentation for hoisting-setstate-captured-indirectly-jsx.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

// @validatePreserveExistingMemoizationGuarantees
function useFoo() {
  const onClick = response => {
    setState(DISABLED_FORM);
  };

  const [state, setState] = useState();
  const handleLogout = useCallback(() => {
    setState(DISABLED_FORM);
  }, [setState]);
  const getComponent = () => {
    return <ColumnItem onPress={() => handleLogout()} />;
  };

  // this `getComponent` call should not be inferred as mutating setState
  return [getComponent(), onClick]; // pass onClick to avoid dce
}

Subdomains

Functions

Frequently Asked Questions

What does hoisting-setstate-captured-indirectly-jsx.js do?
hoisting-setstate-captured-indirectly-jsx.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 hoisting-setstate-captured-indirectly-jsx.js?
hoisting-setstate-captured-indirectly-jsx.js defines 1 function(s): useFoo.
Where is hoisting-setstate-captured-indirectly-jsx.js in the architecture?
hoisting-setstate-captured-indirectly-jsx.js is located at compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/hoisting-setstate-captured-indirectly-jsx.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