diff --git a/reflex/components/tags/iter_tag.py b/reflex/components/tags/iter_tag.py index 47e910cd1..d080dbf82 100644 --- a/reflex/components/tags/iter_tag.py +++ b/reflex/components/tags/iter_tag.py @@ -130,10 +130,14 @@ class IterTag(Tag): raise ValueError("The render function must take 2 arguments.") component = self.render_fn(arg, index) - # Nested foreach components, cond and tuples must be wrapped in fragments. - if isinstance(component, (Foreach, Cond, tuple)): + # Nested foreach components, cond must be wrapped in fragments. + if isinstance(component, (Foreach, Cond)): component = Fragment.create(component) + # If the component is a tuple, unpack and wrap it in a fragment. + if isinstance(component, tuple): + component = Fragment.create(*component) + # Set the component key. if component.key is None: component.key = index