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

Function use_toggle

src/py/reactpy/tests/tooling/hooks.py:8–10  ·  view source on GitHub ↗
(init=False)

Source from the content-addressed store, hash-verified

6
7
8def use_toggle(init=False):
9 state, set_state = use_state(init)
10 return state, lambda: set_state(lambda old: not old)
11
12
13def use_counter(initial_value):

Callers 5

RootFunction · 0.90
MyComponentFunction · 0.90
RootComponentFunction · 0.90
RootFunction · 0.90
ParentFunction · 0.90

Calls 1

use_stateFunction · 0.90

Tested by 5

RootFunction · 0.72
MyComponentFunction · 0.72
RootComponentFunction · 0.72
RootFunction · 0.72
ParentFunction · 0.72