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

Function ButtonSwapsDivs

src/py/reactpy/tests/test_testing.py:196–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195 @component
196 def ButtonSwapsDivs():
197 count = Ref(0)
198
199 async def on_click(event):
200 mount(make_next_count_constructor(count))
201
202 incr = html.button({"on_click": on_click, "id": "incr-button"}, "incr")
203
204 mount, make_hostswap = _hotswap(update_on_change=True)
205 mount(make_next_count_constructor(count))
206 hotswap_view = make_hostswap()
207
208 return html.div(incr, hotswap_view)
209
210 await display.show(ButtonSwapsDivs)
211

Callers

nothing calls this directly

Calls 4

RefClass · 0.90
_hotswapFunction · 0.90
mountFunction · 0.85

Tested by

no test coverage detected