We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 81a1b2f commit d3c4273Copy full SHA for d3c4273
reflex/compiler/utils.py
@@ -417,7 +417,7 @@ def create_document_root(
417
*maybe_head_components,
418
*always_head_components,
419
]
420
- return Html.create(
+ html_component = Html.create(
421
Head.create(*head_components),
422
Body.create(
423
Var("children"),
@@ -427,6 +427,11 @@ def create_document_root(
427
lang=html_lang or "en",
428
custom_attrs=html_custom_attrs or {},
429
)
430
+ hooks = html_component._get_all_hooks()
431
+ if hooks:
432
+ msg = "You cannot use stateful components or hooks in the document root. Check your head components."
433
+ raise ValueError(msg)
434
+ return html_component
435
436
437
def create_theme(style: ComponentStyle) -> dict:
0 commit comments