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

Function Counter

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

Source from the content-addressed store, hash-verified

20test('fireEvent triggers useEffect calls', () => {
21 const effectCb = jest.fn()
22 function Counter() {
23 React.useEffect(effectCb)
24 const [count, setCount] = React.useState(0)
25 return <button onClick={() => setCount(count + 1)}>{count}</button>
26 }
27 const {
28 container: {firstChild: buttonNode},
29 } = render(<Counter />)

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…