def __setstate__(self, state: dict[str, Any]):
        """Set the state from redis deserialization.

        This method is called by pickle to deserialize the object.

        Args:
            state: The state dict for deserialization.
        """
        state["parent_state"] = None
        state["substates"] = {}
        for key, value in state.items():
            object.__setattr__(self, key, value)
Set the state from redis deserialization.

        This method is called by pickle to deserialize the object.

        Args:
            state: The state dict for deserialization.
        
reflex/state.py