MCPcopy Create free account
hub / github.com/testing-library/react-testing-library / MyUselessComponent

Function MyUselessComponent

src/__tests__/act.js:6–9  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4test('render calls useEffect immediately', () => {
5 const effectCb = jest.fn()
6 function MyUselessComponent() {
7 React.useEffect(effectCb)
8 return null
9 }
10 render(<MyUselessComponent />)
11 expect(effectCb).toHaveBeenCalledTimes(1)
12})

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…