TreePropProvider

inline fun TreePropProvider(vararg props: TreePropValuePair<*>, component: () -> Component): Component

A component which provides one or more TreeProp values to the given child hierarchy. A tree prop is a mapping from a TreeProp key object to an value of a corresponding type which is accessible throughout the entire subtree where it's defined.

Tree props are useful for providing theme info, logging tags, or other things that generally need to be available throughout a hierarchy, without having to manual thread them through as individual props. Tree prop value of a specific TreeProp can be accessed in children via TreeProp.value property in ComponentScope.


inline fun TreePropProvider(vararg props: ClassValuePair<*>, component: () -> Component): TreePropProviderImpl

Deprecated

Please, use the new [TreePropProvider] with [TreePropValuePair] args. You can use [createLegacyTreeProp] for interoperability with old API

A component which provides one or more tree props to the given child hierarchy. A tree prop is a mapping from a type to an instance of that type which is accessible throughout the entire subtree where it's defined.

Tree props are useful for providing theme info, logging tags, or other things that generally need to be available throughout a hierarchy, without having to manual thread them through as individual props. Tree props can be accessed in children via getTreeProp.