MCPcopy
hub / github.com/dai-shi/react-tracked / Counter

Function Counter

examples/01_counter/src/app.tsx:37–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35let numRendered = 0;
36
37const Counter = () => {
38 const [state, dispatch] = useTracked();
39 return (
40 <div>
41 numRendered: {++numRendered}
42 <div>
43 <span>Count: {state.count}</span>
44 <button type="button" onClick={() => dispatch({ type: 'increment' })}>
45 +1
46 </button>
47 <button type="button" onClick={() => dispatch({ type: 'decrement' })}>
48 -1
49 </button>
50 </div>
51 </div>
52 );
53};
54
55const TextBox = () => {
56 const [state, dispatch] = useTracked();

Callers

nothing calls this directly

Calls 1

useTrackedFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…