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

Function make_next_count_constructor

src/py/reactpy/tests/test_testing.py:186–193  ·  view source on GitHub ↗

We need to construct a new function so they're different when we set_state

(count)

Source from the content-addressed store, hash-verified

184 """
185
186 def make_next_count_constructor(count):
187 """We need to construct a new function so they're different when we set_state"""
188
189 def constructor():
190 count.current += 1
191 return html.div({"id": f"hotswap-{count.current}"}, count.current)
192
193 return constructor
194
195 @component
196 def ButtonSwapsDivs():

Callers 2

on_clickFunction · 0.85
ButtonSwapsDivsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected