SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

0 0 154 C++

Revisit timing to capture old/new nodes (#56877)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56877

## Changelog:

[Internal] [Changed] - Revisit timing to capture old/new nodes

Previously, when `applyViewTransitionName` is called from react reconciler, if there is active viewtransition, we decide it's applying to new node. This was incorrect because `applyViewTransitionName(old)` for next transition can be called when the previous transition is still ongoing. In fact `applyViewTransitionName(old)` is guaranteed to be called before mutationCallback in a transition while `applyViewTransitionName(new)` is inside mutationCallback. So that is a better criteria to separate old and new cases. Given mutationCallback is synchronous on JS thread we can just use a boolean flag to tell the timing.

Given this interleaved situation, when we clean up resources (for new/old nodes) of a transition at its end, we should also avoid removing those for a pending transition. Introducing transitionId for this case.

Reviewed By: Abbondanzo

Differential Revision: D105214322

fbshipit-source-id: 6c719964921db2e76421e9917151076c97d1d623
Z
Zeya Peng committed
ee43ce7dba328baf48b403696eee1dbbdefeb302
Parent: 61c8b04
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 5/29/2026, 9:21:17 PM