What's Changed
This release includes stability fixes for Layout Animations and Shared Element Transitions, fixes several crashes on Android, and stops synchronously updated props from going back to old values.
🐛 Bug fixes
- Fix a reset of synchronously updated props to old values when a commit moves a view to another position in its parent, for example after a
zIndexchange of a sibling, on iOS and on Android withenableAccumulatedUpdatesInRawPropsAndroid. (#10800 by @pawicao) - Fix an Android crash with
[Reanimated] Unknown sensor type.inuseAnimatedSensoron devices that deliver sensor events labeled with a sensor other than the registered one. (#10792 by @pawicao) - Fix an Android crash with
react-native-screensbefore 4.27 when a native stack screen that holds a nested stack with header buttons is removed. (#10754 by @bartlomiejbloniarz) - Fix shared element transitions casting the props of a nested
<Text>with asharedTransitionTagon Android to view props. (#10741 by @bartlomiejbloniarz) - Fix a native crash on Android caused by reading
opacityfrom the props of a<Text>nested in another<Text>as if they were view props. (#10732 by @hirvesh) - Fix
withTimingextrapolating its easing when the first frame reports a timestamp earlier than the animation'sstartTime, which happens when the animation is started outside a frame flush. With an easing whose first control point isx1 = 0the Newton-Raphson solver inEasing.bezierdiverges just outside its domain, so the animated value could land orders of magnitude out of range for a single frame. (#10720 by @piaskowyk) - Flush completed exiting view removals in the legacy layout animations proxy when Android's mounting coordinator pull model is enabled. (#10704 by @piaskowyk)
- Fix exiting Layout Animations leaking their views on Android under the mounting coordinator pull model, where the structural cleanup of a finished animation was never flushed. (#10682 by @piaskowyk)
- Fix a crash of the Layout Animations proxy (
shadowIndex is out of range,Indices are wrong in Remove mutation, or memory corruption in release builds) when a view flattens in the same commit in which its parent unflattens. (#10676 by @bartlomiejbloniarz) - Fix an Android crash in
performOperationswhen the React host is torn down while a CSS or layout animation runs in the background, for example on anexpo-updatesrestart. (#10661 by @bartlomiejbloniarz) - Fix an animated view that showed an older value for one frame when a React commit mounted over a newer synchronous write, with
ANDROID_SYNCHRONOUSLY_UPDATE_UI_PROPSorIOS_SYNCHRONOUSLY_UPDATE_UI_PROPSon. (#10631 by @pawicao) - Fix a crash in
useAnimatedKeyboardon iOS when the app delegate does not declarewindow, as in apps that use the UIScene lifecycle. (#10587 by @CAMOBAP) - Skip synchronous Android prop updates for unmounted views to avoid throwing and logging mounting-layer exceptions on the UI thread. (#10435 by @ryan-saffer)
💡 Others
- Initialize the layout animations light tree root from the committed root shadow node. (#10737 by @bartlomiejbloniarz)
- Simplify the light tree based Layout Animations proxy so that every view React deletes waits for one decision of how it exits, and name the states of a light node after what they mean. (#10677 by @bartlomiejbloniarz)
- Rename the
DEADexiting state of the light tree based Layout Animations proxy toCOMPLETED. (#10629 by @bartlomiejbloniarz)
Full Changelog: 4.7.0...4.7.1