def _iter_parent_classes_with_method(cls, method: str) -> Iterator[type[Component]]:
        """Iterate through parent classes that define a given method.

        Used for handling the `add_*` API functions that internally simulate a super() call chain.

        Args:
            method: The method to look for.

        Yields:
            The parent classes that define the method (differently than the base).
        """
        seen_methods = (
            {getattr(Component, method)} if hasattr(Component, method) else set()
        )
        for clz in cls.mro():
            if clz is Component:
                break
            if not issubclass(clz, Component):
                continue
            method_func = getattr(clz, method, None)
            if not callable(method_func) or method_func in seen_methods:
                continue
            seen_methods.add(method_func)
            yield clz
Iterate through parent classes that define a given method.

        Used for handling the `add_*` API functions that internally simulate a super() call chain.

        Args:
            method: The method to look for.

        Yields:
            The parent classes that define the method (differently than the base).
        
reflex/components/component.py