From da668bf476fe91a1e9e2779cf58807dd786d915b Mon Sep 17 00:00:00 2001 From: Shashank Bhatotia Date: Sun, 21 Jun 2026 17:24:28 +0530 Subject: [PATCH] Skip dropped mapped node in PropsAnimatedNode.updateView instead of crashing A mapped child node can be removed from NativeAnimatedNodesManager (e.g. its component unmounted during a navigation transition) between animation frames while the prop node is still queued for an update. updateView() then calls requireNotNull on the missing node and throws IllegalArgumentException: "Mapped property node does not exist", crashing the app on a benign teardown race. Skip the stale node instead, mirroring the connectedViewTag == -1 early-return at the top of the method. Fixes #37267. --- .../com/facebook/react/animated/PropsAnimatedNode.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt index 753697ac61a9..2302049317f0 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/animated/PropsAnimatedNode.kt @@ -75,7 +75,15 @@ internal class PropsAnimatedNode( } for ((key, value) in propNodeMapping) { val node = nativeAnimatedNodesManager.getNodeById(value) - requireNotNull(node) { "Mapped property node does not exist" } + // A mapped child node can be dropped (e.g. its component unmounted during + // navigation) between animation frames while this prop node is still + // queued for an update. Skip the stale node instead of throwing: the + // connected view is being torn down, so there is no meaningful value to + // write for this prop on this frame. Mirrors the connectedViewTag == -1 + // early-return above. Fixes #37267. + if (node == null) { + continue + } if (node is StyleAnimatedNode) { node.collectViewUpdates(propMap) } else if (node is ValueAnimatedNode) {