Skip to content

Commit 46b76f4

Browse files
colriotfacebook-github-bot
authored andcommitted
Make TreeProps accessible from ResourcesScope
Summary: There is no need for ComponentScope, it's not a real hook Reviewed By: astreet Differential Revision: D55804214 fbshipit-source-id: 436942f28d0d3e8fd3b038e123828da90479caef
1 parent 9b679d8 commit 46b76f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

litho-core/src/main/java/com/facebook/litho/KTreeProps.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ private fun <T> ComponentScope.createTreeProp(prop: TreeProp<out T>, value: T) {
122122
* registered. Tree props are registered for a sub-hierarchy via [TreePropProvider] or
123123
* [com.facebook.litho.annotations.OnCreateTreeProp] in the Spec API.
124124
*/
125-
inline fun <reified T : Any> ComponentScope.getTreeProp(): T? = context.getTreeProp(T::class.java)
125+
inline fun <reified T : Any> ResourcesScope.getTreeProp(): T? = context.getTreeProp(T::class.java)
126126

127127
/**
128128
* Returns the instance registered for the type [T] in this hierarchy, throws if no value was
129129
* registered. Tree props are registered for a sub-hierarchy via [TreePropProvider] or
130130
* [com.facebook.litho.annotations.OnCreateTreeProp] in the Spec API.
131131
*/
132-
inline fun <reified T : Any> ComponentScope.requireTreeProp(): T = checkNotNull(getTreeProp())
132+
inline fun <reified T : Any> ResourcesScope.requireTreeProp(): T = checkNotNull(getTreeProp())

0 commit comments

Comments
 (0)