Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
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
8
def
use_toggle(init=False):
9
state, set_state = use_state(init)
10
return
state,
lambda
: set_state(
lambda
old: not old)
11
12
13
def
use_counter(initial_value):
Callers
5
Root
Function · 0.90
MyComponent
Function · 0.90
RootComponent
Function · 0.90
Root
Function · 0.90
Parent
Function · 0.90
Calls
1
use_state
Function · 0.90
Tested by
5
Root
Function · 0.72
MyComponent
Function · 0.72
RootComponent
Function · 0.72
Root
Function · 0.72
Parent
Function · 0.72