-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow passing ReadableNativeMap/Array to push/put methods #32910
Closed
Conversation
This file contains 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
facebook-github-bot
added
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Contributor
A React Native contributor.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
labels
Jan 18, 2022
react-native-bot
added
the
Type: Enhancement
A new feature or enhancement of an existing feature.
label
Jan 18, 2022
6 tasks
Base commit: 5b489d5 |
Base commit: 5b489d5 |
@yungsters has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @janicduplessis in 3a07dcf. When will my fix make it into a release? | Upcoming Releases |
piaskowyk
pushed a commit
to software-mansion/react-native-reanimated
that referenced
this pull request
Feb 2, 2022
## Description Sometimes RN passes ReadableMap/Array instead of WritableMap/Array when updateProps is called. Currently adding a ReadableMap/Array to a WritableMap/Array is not supported (I opened a PR to allow it since there's no reason it can't be allowed facebook/react-native#32910). In the meantime we have to check if it's not Writable and copy before adding it. Fixes #2722 ## Changes ## Screenshots / GIFs N/A ## Test code and steps to reproduce I'm not sure exactly what the minimum repro is, I could 100% repro the crash in an app, but wasn't able to isolate. The app makes heavy usage of a bottom sheet lib that uses reanimated. I was able to repro a few times in the example app with the repro in the linked issue, but not consistently. In the app where I could repro consistently I verified that it no longer crashes after this change. ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
aeddi
pushed a commit
to aeddi/react-native-reanimated
that referenced
this pull request
Mar 22, 2022
## Description Sometimes RN passes ReadableMap/Array instead of WritableMap/Array when updateProps is called. Currently adding a ReadableMap/Array to a WritableMap/Array is not supported (I opened a PR to allow it since there's no reason it can't be allowed facebook/react-native#32910). In the meantime we have to check if it's not Writable and copy before adding it. Fixes software-mansion#2722 ## Changes ## Screenshots / GIFs N/A ## Test code and steps to reproduce I'm not sure exactly what the minimum repro is, I could 100% repro the crash in an app, but wasn't able to isolate. The app makes heavy usage of a bottom sheet lib that uses reanimated. I was able to repro a few times in the example app with the repro in the linked issue, but not consistently. In the app where I could repro consistently I verified that it no longer crashes after this change. ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Contributor
A React Native contributor.
Merged
This PR has been merged.
Shared with Meta
Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Type: Enhancement
A new feature or enhancement of an existing feature.
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.
Summary
This allow adding ReadableNativeArray/Map to a WritableNativeArray/Map. There is no reason why this can't be allowed, the types were actually updated in 1a29371#diff-d1dc45892b3ba242aed9a1bf7219d2838fae8c7a654c402ba70bc4b100149624, but the assertion remains.
Changelog
[Internal] [Added] - Allow passing ReadableNativeMap/Array to push/put methods
Test Plan
Tested that RN tester builds and run correctly on android.