diff --git a/pynecone/components/layout/foreach.py b/pynecone/components/layout/foreach.py index a06242136..33a8c37cc 100644 --- a/pynecone/components/layout/foreach.py +++ b/pynecone/components/layout/foreach.py @@ -36,6 +36,7 @@ class Foreach(Component): type_ = iterable.type_.__args__[0] except Exception: type_ = Any + iterable = Var.create(iterable) # type: ignore if iterable.type_ == Any: raise TypeError( f"Could not foreach over var of type Any. (If you are trying to foreach over a state var, add a type annotation to the var.)"