fix(#555): drop removed View.propTypes spread that breaks RN 0.63 plus#793
Open
jim-daf wants to merge 1 commit into
Open
fix(#555): drop removed View.propTypes spread that breaks RN 0.63 plus#793jim-daf wants to merge 1 commit into
jim-daf wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a React Native 0.63+ compatibility issue by removing use of View.propTypes, which was removed from RN and can trigger runtime errors when downstream tooling inspects/spreads the resulting PropTypes objects.
Changes:
- Removed
...View.propTypesfrom iOSTwilioVideocomponent PropTypes. - Removed
Viewimport and...View.propTypesspread from Android component PropTypes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/TwilioVideo.ios.js | Drops ...View.propTypes from static propTypes to prevent RN 0.63+ failures. |
| src/TwilioVideo.android.js | Removes View import and ...View.propTypes spread from PropTypes to avoid referencing removed RN API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
154
to
155
| autoInitializeCamera: PropTypes.bool, | ||
| ...View.propTypes, | ||
| }; |
There was a problem hiding this comment.
Now that ...View.propTypes has been removed, View is no longer referenced anywhere in this file. Please drop View from the react-native import to avoid leaving an unused dependency (and potential lint/tooling warnings in downstream projects).
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.
Closes #555.
Why the call sometimes failed
Both
TwilioVideocomponents copy the hostViewprop list with...View.propTypesso consumers can pass through native view props. That field was removed from React Native in version 0.63 and now resolves toundefined. Spreading it into an object literal is silent at runtime, but as soon as a downstream consumer or a PropTypes-aware helper reaches for the resulting list it goes through Babel's_toConsumableArray, which throws the exact error reported in the issue.Fix
Remove the dead spread from both the Android and iOS components and drop the now-unused
Viewimport on Android.The remaining explicit
PropTypes.func,PropTypes.bool,PropTypes.stringentries fully describe the public API, so consumers keep the same prop validation behaviour they had on RN 0.62 and earlier.