Skip to content

Commit

Permalink
Expose reified legacyTreePropsOf
Browse files Browse the repository at this point in the history
Summary: $title

Reviewed By: pentiumao

Differential Revision: D59961579

fbshipit-source-id: 504b39b3eff3ac46cbe66d992989a1d7f1ad9518
  • Loading branch information
kingsleyadio authored and facebook-github-bot committed Jul 19, 2024
1 parent 9ee3496 commit fef5b07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion litho-core/src/main/java/com/facebook/litho/KTreeProps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typealias TreePropValuePair<T> = Pair<TreeProp<T>, T>
@Suppress("FunctionName")
@Deprecated(
"Please, use the new [TreePropProvider] with [TreePropValuePair] args. You can use " +
"[createLegacyTreeProp] for interoperability with old API")
"[legacyTreePropOf] for interoperability with old API")
inline fun TreePropProvider(
vararg props: ClassValuePair<*>,
component: () -> Component
Expand Down
4 changes: 4 additions & 0 deletions litho-core/src/main/java/com/facebook/litho/TreeProps.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ fun <T : Any> legacyTreePropOf(clazz: Class<T>): TreeProp<T?> {
return ClassBasedTreeProp(clazz)
}

inline fun <reified T : Any> legacyTreePropOf(): TreeProp<T?> {
return legacyTreePropOf(T::class.java)
}

fun <T> treePropOf(defaultValueProducer: () -> T): TreeProp<T> {
return ObjectBasedTreeProp(defaultValueProducer)
}

0 comments on commit fef5b07

Please sign in to comment.