Skip to content

Commit 15320bc

Browse files
committed
handle Var component as component
1 parent 6d34f26 commit 15320bc

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

reflex/experimental/memo.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,14 @@ def _is_component_annotation(annotation: Any) -> bool:
253253
Whether the annotation resolves to Component.
254254
"""
255255
origin = get_origin(annotation) or annotation
256-
return isinstance(origin, type) and issubclass(origin, Component)
256+
return isinstance(origin, type) and (
257+
issubclass(origin, Component)
258+
or bool(
259+
issubclass(origin, Var)
260+
and (args := get_args(annotation))
261+
and issubclass(args[0], Component)
262+
)
263+
)
257264

258265

259266
def _children_annotation_is_valid(annotation: Any) -> bool:

0 commit comments

Comments
 (0)