Skip to content

Commit 745ca1b

Browse files
committed
fix few stuff
1 parent d0ce7ff commit 745ca1b

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

reflex/components/component.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1516,7 +1516,7 @@ def _iter_parent_classes_with_method(cls, method: str) -> Sequence[type[Componen
15161516
Returns:
15171517
A sequence of parent classes that define the method (differently than the base).
15181518
"""
1519-
current_class_method = getattr(cls, method, None)
1519+
current_class_method = getattr(Component, method, None)
15201520
seen_methods = (
15211521
{current_class_method} if current_class_method is not None else set()
15221522
)

reflex/istate/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def from_router_data(cls, router_data: dict) -> "HeaderData":
8585

8686
@serializer(to=dict)
8787
def _serialize_header_data(obj: HeaderData) -> dict:
88-
return dataclasses.asdict(obj)
88+
return {k.name: getattr(obj, k.name) for k in dataclasses.fields(obj)}
8989

9090

9191
@serializer(to=dict)

reflex/utils/types.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,9 @@ def is_valid_var_type(type_: type) -> bool:
856856

857857
if is_union(type_):
858858
return all(is_valid_var_type(arg) for arg in get_args(type_))
859+
860+
type_ = origin if (origin := get_origin(type_)) is not None else type_
861+
859862
return (
860863
issubclass(type_, StateVarTypes)
861864
or serializers.has_serializer(type_)

0 commit comments

Comments
 (0)