Skip to content

Commit f4f9e17

Browse files
mdvaccameta-codesync[bot]
authored andcommitted
Fix FieldsBelowInit: Reorder properties in PropsAnimatedNode (#55363)
Summary: Pull Request resolved: #55363 Fixed FieldsBelowInit lint error in PropsAnimatedNode.kt. Moved `connectedView` computed property above the init block to follow Kotlin initialization order conventions. changelog: [internal] internal Reviewed By: cortinico Differential Revision: D91738282 fbshipit-source-id: 723a7f04b74c41144c9092fc6ef7cafe07adc550
1 parent 707fd69 commit f4f9e17

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ internal class PropsAnimatedNode(
2929
private val propMap = JavaOnlyMap()
3030
private var connectedViewUIManager: UIManager? = null
3131

32+
val connectedView: View?
33+
// resolveView throws an [IllegalViewOperationException] when the view doesn't exist
34+
// (this can happen if the surface is being deallocated).
35+
get() = runCatching { connectedViewUIManager?.resolveView(connectedViewTag) }.getOrNull()
36+
3237
init {
3338
val props = config.getMap("props")
3439
val iter = props?.keySetIterator()
@@ -112,11 +117,6 @@ internal class PropsAnimatedNode(
112117
connectedViewUIManager?.synchronouslyUpdateViewOnUIThread(connectedViewTag, propMap)
113118
}
114119

115-
val connectedView: View?
116-
// resolveView throws an [IllegalViewOperationException] when the view doesn't exist
117-
// (this can happen if the surface is being deallocated).
118-
get() = runCatching { connectedViewUIManager?.resolveView(connectedViewTag) }.getOrNull()
119-
120120
override fun prettyPrint(): String =
121121
"PropsAnimatedNode[$tag] connectedViewTag: $connectedViewTag " +
122122
"propNodeMapping: $propNodeMapping propMap: $propMap"

0 commit comments

Comments
 (0)