diff --git a/reflex/components/component.py b/reflex/components/component.py index 3cfe5b3ae..60214a81e 100644 --- a/reflex/components/component.py +++ b/reflex/components/component.py @@ -690,9 +690,13 @@ class Component(BaseComponent, ABC): Yields: The components in the props. """ - for prop in self.get_props(): - value = getattr(self, prop) - yield from _components_from(value) + yield from ( + component + for prop in self.get_props() + if (value := getattr(self, prop)) is not None + and isinstance(value, (BaseComponent, Var)) + for component in _components_from(value) + ) @classmethod def create(cls, *children, **props) -> Self: