-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: undefined View propTypes issue #820
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -43,8 +43,8 @@ export default class Carousel extends Component { | |||||
| autoplayDelay: PropTypes.number, | ||||||
| autoplayInterval: PropTypes.number, | ||||||
| callbackOffsetMargin: PropTypes.number, | ||||||
| containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||||||
| contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||||||
| containerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes ? View.propTypes.style : () => null, | ||||||
| contentContainerCustomStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes ? View.propTypes.style : () => null, | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry - terrible at using this github stuff!!! You change did not fix the problem, still got red errors in chrome.... The following (just in the Carousel.js) did fix it as a slight mod to yours:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @cyphire. Which device and browser are you testing it from? The fix was working fine on a Windows 10 Chrome browser. The only difference in your code is checking that
Suggested change
But again, in which case do you get a |
||||||
| enableMomentum: PropTypes.bool, | ||||||
| enableSnap: PropTypes.bool, | ||||||
| firstItem: PropTypes.number, | ||||||
|
|
@@ -61,7 +61,7 @@ export default class Carousel extends Component { | |||||
| scrollEnabled: PropTypes.bool, | ||||||
| scrollInterpolator: PropTypes.func, | ||||||
| slideInterpolatedStyle: PropTypes.func, | ||||||
| slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, | ||||||
| slideStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes ? View.propTypes.style : () => null, | ||||||
| shouldOptimizeUpdates: PropTypes.bool, | ||||||
| swipeThreshold: PropTypes.number, | ||||||
| useScrollView: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), | ||||||
|
|
||||||
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.
instead... Your's didnt work for me, but the ?. does....
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.
these solutions are awesome I'll try it out right away