create



Creates a root ComponentTree hosted by activity, which is also its context.


Creates a root ComponentTree hosted by host, the Fragment or Activity that creates it.

host is both the tree's lifecycle owner, exposed to components through LifecycleOwnerTreeProp, and its saved-state owner. A Fragment passes itself, not viewLifecycleOwner, so it can create the tree as early as onCreate. context is the context the tree renders with, which can differ from the host's, such as a themed wrapper. Nested ComponentTrees should continue to use createNestedComponentTree so they inherit these dependencies from their parent.


Like create(Context, SavedStateRegistryOwner), keeping the Litho configuration and TreeProps already installed on context.