Skip to content

Commit b7c7197

Browse files
fix initial state without cv fallback (#3670)
1 parent 2158586 commit b7c7197

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

reflex/compiler/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,9 @@ def compile_state(state: Type[BaseState]) -> dict:
152152
console.warn(
153153
f"Failed to compile initial state with computed vars, excluding them: {e}"
154154
)
155-
initial_state = state(_reflex_internal_init=True).dict(include_computed=False)
155+
initial_state = state(_reflex_internal_init=True).dict(
156+
initial=True, include_computed=False
157+
)
156158
return format.format_state(initial_state)
157159

158160

reflex/state.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1784,7 +1784,7 @@ def dict(
17841784
prop_name: self.get_value(getattr(self, prop_name))
17851785
for prop_name in self.base_vars
17861786
}
1787-
if initial:
1787+
if initial and include_computed:
17881788
computed_vars = {
17891789
# Include initial computed vars.
17901790
prop_name: (

0 commit comments

Comments
 (0)