MCPcopy
hub / github.com/facebook/react / Foo

Function Foo

packages/react-debug-tools/src/__tests__/ReactHooksInspection-test.js:36–39  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

34
35 it('should inspect a simple useState hook', () => {
36 function Foo(props) {
37 const [state] = React.useState('hello world');
38 return <div>{state}</div>;
39 }
40 const tree = ReactDebugTools.inspectHooks(Foo, {});
41 expect(normalizeSourceLoc(tree)).toMatchInlineSnapshot(`
42 [

Callers

nothing calls this directly

Calls 7

useBazFunction · 0.85
entriesMethod · 0.80
useCustomFunction · 0.70
useBarFunction · 0.70
useFormStatusFunction · 0.70
useStateFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected