You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@adhami3310 is there a reason we treat the tuple like a list instead of calling figure_out_type on each element?
diff --git a/reflex/vars/base.py b/reflex/vars/base.py
index 708548f0..689a75f4 100644
--- a/reflex/vars/base.py+++ b/reflex/vars/base.py@@ -1750,7 +1750,7 @@ def figure_out_type(value: Any) -> types.GenericType:
if isinstance(value, set):
return set[unionize(*(figure_out_type(v) for v in value))]
if isinstance(value, tuple):
- return tuple[unionize(*(figure_out_type(v) for v in value)), ...]+ return tuple[*(figure_out_type(v) for v in value)]
if isinstance(value, Mapping):
if not value:
return Mapping[NoReturn, NoReturn]
Describe the bug
Compiling raises a TypeError when using rx.foreach with list of tuples.
Error: TypeError: Invalid var passed for prop Avatar.src, expected type <class 'str'>, got value category.at(1) of type typing.Union[int, str].
Compiling succeeds only when removing first element (or replacing with string type)
(or when rx.avatar is removed or replaced with rx.text)
To Reproduce
Expected behavior
Compile succeeds, application runs and data is displayed.
Screenshots
n/a
Specifics (please complete the following information):
Additional context
n/a
The text was updated successfully, but these errors were encountered: