-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Fix "Illegal type provided" crash #2853
Conversation
This PR seems to be working for me as well on RN 0.67.0 and does indeed fix #2722 🚀 @piaskowyk, could you take a look at this? |
@janicduplessis Here's a minimum (literally, a few lines) repro: #2905 |
To resolve it I prepared PR to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
@piaskowyk We are facing many ANR which could be fixed by this change so any idea on the next release cycle? |
## 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
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