findViewWithTag

open fun <T : View?> findViewWithTag(tag: Any): T

A utility function to find the View with a given tag under the current Component's LithoView. To set a view tag, use the .viewTag() common prop or Style.viewTag. An appropriate time to call this is in your Component's onVisible callback.

As with View.findViewWithTag in general, this must be called on the main thread.

Note that null may be returned if the associated View doesn't exist or isn't mounted: with incremental mount turned on (which is the default), if the component is off-screen, it won't be mounted.

Finally, note that you should never hold a reference to the view returned by this function as Litho may unmount your Component and mount it to a different View.