Skip to content

Commit dd4e6a6

Browse files
committed
cleanup
1 parent 24d08e9 commit dd4e6a6

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/reactpy/executors/asgi/pyscript.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,10 @@ class ReactPyPyscriptApp(ReactPyApp):
106106
def render_index_html(self) -> None:
107107
"""Process the index.html and store the results in this class."""
108108
head_content = vdom_head_to_html(self.parent.html_head)
109-
body_content = (
110-
""
111-
if self.parent.prepend_body is None
112-
else reactpy_to_string(self.parent.prepend_body)
113-
)
109+
if not self.parent.prepend_body or self.parent.prepend_body == ...:
110+
prepend_body = ""
111+
else:
112+
prepend_body = reactpy_to_string(self.parent.prepend_body)
114113
pyscript_setup = pyscript_setup_html(
115114
extra_py=self.parent.extra_py,
116115
extra_js=self.parent.extra_js,
@@ -128,7 +127,7 @@ def render_index_html(self) -> None:
128127
f'<html lang="{self.parent.html_lang}">'
129128
f"{head_content}"
130129
"<body>"
131-
f"{body_content}"
130+
f"{prepend_body}"
132131
f"{pyscript_component}"
133132
"</body>"
134133
"</html>"

0 commit comments

Comments
 (0)