fix: Support Map-based listeners in AnimatedPoint (RN 0.83+ compatibility)#4113
Open
sleda wants to merge 1 commit intornmapbox:mainfrom
Open
fix: Support Map-based listeners in AnimatedPoint (RN 0.83+ compatibility)#4113sleda wants to merge 1 commit intornmapbox:mainfrom
sleda wants to merge 1 commit intornmapbox:mainfrom
Conversation
… and Map listeners for RN >= 0.83
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes crash on React Native 0.83+ related to AnimatedPoint.
In React Native 0.83, the underlying Animated nodes (inherited via AnimatedWithChildren) changed the internal _listeners storage from a plain Object to a Map.
The AnimatedPoint class was unconditionally overwriting this._listeners = {} in its constructor and accessing it using object notation (this._listeners[id]), which caused crashes on newer React Native versions when using AnimatedPoint or ShapeSource with animated coordinates.
Changes:
Test Plan
I have successfully tested this fix on React Native 0.83.0-rc.5 with New Architecture (Fabric) enabled on iOS 26.2. The crash is resolved, and animated location updates work as expected.
Reproduction / Validation Steps
I utilized the following minimal reproduction component to isolate the issue:
Results:
And works smoothly.
Checklist