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

Function HasScript

src/py/reactpy/tests/test_html.py:21–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20 @component
21 def HasScript():
22 return html.script(
23 """() => {
24 const mapping = {"false": false, "true": true};
25 const mountStateEl = document.getElementById("mount-state");
26 mountStateEl.setAttribute(
27 "data-value", !mapping[mountStateEl.getAttribute("data-value")]);
28 return () => mountStateEl.setAttribute(
29 "data-value", !mapping[mountStateEl.getAttribute("data-value")]);
30 }"""
31 )
32
33 await display.show(Root)
34

Callers 1

RootFunction · 0.85

Calls 1

use_counterFunction · 0.90

Tested by

no test coverage detected