File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change
1
+ from reactpy import component , html
2
+
3
+
4
+ @component
5
+ def main ():
6
+ return html .div ({"id" : "custom-root" }, "Component with a custom root name." )
Original file line number Diff line number Diff line change 14
14
< body >
15
15
< h1 > ReactPy PyScript Test Page</ h1 >
16
16
< hr >
17
- {% pyscript_component "./test_app/pyscript/components/hello_world.py" %}
17
+ {% pyscript_component "./test_app/pyscript/components/hello_world.py" initial="< div id ='hello-world-loading '> Loading...</ div > " %}
18
+ < hr >
19
+ {% pyscript_component "./test_app/pyscript/components/custom_root.py" root="main" %}
18
20
< hr >
19
21
{% pyscript_component "./test_app/pyscript/components/counter.py" %}
20
22
< hr >
Original file line number Diff line number Diff line change @@ -683,7 +683,9 @@ def test_pyscript_components(self):
683
683
new_page = self .browser .new_page ()
684
684
try :
685
685
new_page .goto (f"{ self .live_server_url } /pyscript/" )
686
+ new_page .wait_for_selector ("#hello-world-loading" )
686
687
new_page .wait_for_selector ("#hello-world" )
688
+ new_page .wait_for_selector ("#custom-root" )
687
689
688
690
new_page .wait_for_selector ("#counter" )
689
691
new_page .wait_for_selector ("#counter pre[data-value='0']" )
You can’t perform that action at this time.
0 commit comments