Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion reflex/compiler/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def create_document_root(
*maybe_head_components,
*always_head_components,
]
return Html.create(
html_component = Html.create(
Head.create(*head_components),
Body.create(
Var("children"),
Expand All @@ -427,6 +427,11 @@ def create_document_root(
lang=html_lang or "en",
custom_attrs=html_custom_attrs or {},
)
hooks = html_component._get_all_hooks()
if hooks:
msg = "You cannot use stateful components or hooks in the document root. Check your head components."
raise ValueError(msg)
Comment thread
adhami3310 marked this conversation as resolved.
return html_component


def create_theme(style: ComponentStyle) -> dict:
Expand Down