MCPcopy Index your code
hub / github.com/reactive-python/reactpy / use_counter

Function use_counter

src/py/reactpy/tests/tooling/hooks.py:13–15  ·  view source on GitHub ↗
(initial_value)

Source from the content-addressed store, hash-verified

11
12
13def use_counter(initial_value):
14 state, set_state = use_state(initial_value)
15 return state, lambda: set_state(lambda old: old + 1)

Callers 2

SomeComponentFunction · 0.90
HasScriptFunction · 0.90

Calls 1

use_stateFunction · 0.90

Tested by 2

SomeComponentFunction · 0.72
HasScriptFunction · 0.72