smarter yield
This commit is contained in:
parent
af4ce357aa
commit
d399748cc3
@ -690,9 +690,13 @@ class Component(BaseComponent, ABC):
|
|||||||
Yields:
|
Yields:
|
||||||
The components in the props.
|
The components in the props.
|
||||||
"""
|
"""
|
||||||
for prop in self.get_props():
|
yield from (
|
||||||
value = getattr(self, prop)
|
component
|
||||||
yield from _components_from(value)
|
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
|
@classmethod
|
||||||
def create(cls, *children, **props) -> Self:
|
def create(cls, *children, **props) -> Self:
|
||||||
|
Loading…
Reference in New Issue
Block a user