Khaleel Al-Adhami 2 viikkoa sitten
vanhempi
säilyke
c3c418183a
2 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  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:
             # only include vars defined in this state
             continue
-        state_key = f"{state_name}.{name}"
+        state_key = f"{state_name}.{name}_rx_state_"
         field_type, options = _compile_client_storage_field(field)
         if field_type is Cookie:
             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
             value = value.__wrapped__
 
+        name = name.removesuffix("_rx_state_")
+
         # Set the var on the parent state.
         if name in self.inherited_vars or name in self.inherited_backend_vars:
             setattr(self.parent_state, name, value)