Skip to content

Commit

Permalink
handle var at top level
Browse files Browse the repository at this point in the history
  • Loading branch information
adhami3310 committed Nov 15, 2024
1 parent 53b9854 commit 88cfb3b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion reflex/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,11 @@ def compile_unevaluated_page(
"""
# Generate the component if it is a callable.
component = page.component
component = component if isinstance(component, Component) else component()
component = (
component
if isinstance(component, Component)
else (Fragment.create(component) if isinstance(component, Var) else component())
)

# unpack components that return tuples in an rx.fragment.
if isinstance(component, tuple):
Expand Down

0 comments on commit 88cfb3b

Please sign in to comment.