Allow passing ReadableNativeMap/Array to push/put methods#32910
Closed
janicduplessis wants to merge 1 commit intofacebook:mainfrom
Closed
Allow passing ReadableNativeMap/Array to push/put methods#32910janicduplessis wants to merge 1 commit intofacebook:mainfrom
janicduplessis wants to merge 1 commit intofacebook:mainfrom
Conversation
6 tasks
Base commit: 5b489d5 |
Base commit: 5b489d5 |
Contributor
|
@yungsters has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Collaborator
|
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
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.
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.