Khaleel Al-Adhami hai 2 semanas
pai
achega
c3c418183a
Modificáronse 2 ficheiros con 3 adicións e 1 borrados
  1. 1 1
      reflex/compiler/utils.py
  2. 2 0
      reflex/state.py

+ 1 - 1
reflex/compiler/utils.py

@@ -258,7 +258,7 @@ def _compile_client_storage_recursive(
         if name in state.inherited_vars:
         if name in state.inherited_vars:
             # only include vars defined in this state
             # only include vars defined in this state
             continue
             continue
-        state_key = f"{state_name}.{name}"
+        state_key = f"{state_name}.{name}_rx_state_"
         field_type, options = _compile_client_storage_field(field)
         field_type, options = _compile_client_storage_field(field)
         if field_type is Cookie:
         if field_type is Cookie:
             cookies[state_key] = options
             cookies[state_key] = options

+ 2 - 0
reflex/state.py

@@ -1350,6 +1350,8 @@ class BaseState(Base, ABC, extra=pydantic.Extra.allow):
             # unwrap proxy objects when assigning back to the state
             # unwrap proxy objects when assigning back to the state
             value = value.__wrapped__
             value = value.__wrapped__
 
 
+        name = name.removesuffix("_rx_state_")
+
         # Set the var on the parent state.
         # Set the var on the parent state.
         if name in self.inherited_vars or name in self.inherited_backend_vars:
         if name in self.inherited_vars or name in self.inherited_backend_vars:
             setattr(self.parent_state, name, value)
             setattr(self.parent_state, name, value)