diff --git a/reflex/components/datadisplay/dataeditor.py b/reflex/components/datadisplay/dataeditor.py index edb8eb113..03dec41dd 100644 --- a/reflex/components/datadisplay/dataeditor.py +++ b/reflex/components/datadisplay/dataeditor.py @@ -7,6 +7,7 @@ from reflex.base import Base from reflex.components.component import Component, NoSSRComponent from reflex.components.literals import LiteralRowMarker from reflex.utils import console, format, imports, types +from reflex.utils.serializers import serializer from reflex.vars import ImportVar, Var, get_unique_variable_name LiteralDataEditorGridColumnIcons = Literal[ @@ -408,3 +409,16 @@ class DataEditor(NoSSRComponent): # except ImportError: # pass + + +@serializer +def serialize_data_editor_prop(prop: DataEditorProp) -> dict: + """The serializer for the data editor theme. + + Args: + prop: The prop to serialize. + + Returns: + The serialized prop. + """ + return prop.dict() diff --git a/reflex/utils/serializers.py b/reflex/utils/serializers.py index 40b5c8ffa..665aa10d3 100644 --- a/reflex/utils/serializers.py +++ b/reflex/utils/serializers.py @@ -153,7 +153,7 @@ def serialize_primitive(value: Union[bool, int, float, None]) -> str: @serializer -def serialize_base(value: Base) -> dict: +def serialize_base(value: Base) -> str: """Serialize a Base instance. Args: @@ -162,7 +162,7 @@ def serialize_base(value: Base) -> dict: Returns: The serialized Base. """ - return value.dict() + return value.json() @serializer