MCPcopy
hub / github.com/preactjs/preact / Widget

Function Widget

test-utils/test/shared/act.test.jsx:291–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

289 let counter = 0;
290
291 function Widget() {
292 useEffect(() => {
293 ++counter;
294 });
295 const [, forceUpdate] = useReducer(x => x + 1, 0);
296 return <button onClick={forceUpdate}>test</button>;
297 }
298
299 act(() => {
300 render(<Widget />, scratch);

Callers

nothing calls this directly

Calls 2

useEffectFunction · 0.90
useReducerFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…