findDirectComponentInLithoView

fun findDirectComponentInLithoView(lithoView: LithoView, clazz: Class<out Component?>): Component?

Returns a component of the given class only if the component renders directly to the root component of the LithoView

example:

class FBStory : KComponent() {
override fun ComponentScope.render() {
return Story()
}

findDirectComponentInLithoView will only be able to return Story Component from the LithoView with FBStory as a root

class FBStory : KComponent() {
override fun ComponentScope.render() {
return Column{
child(CommentComponent())
child(AuthorComponent())
}
}
findDirectComponentInLithoView here will only be able to return Column

fun findDirectComponentInLithoView(lithoView: LithoView, clazz: KClass<out Component>): Component?

Returns a component of the given class only if the component renders directly to the root component of the LithoView (for details see: findDirectComponentInLithoView)