-
Notifications
You must be signed in to change notification settings - Fork 26
Reduce warnings #1034
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
Reduce warnings #1034
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -444,7 +444,7 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({ | |||||||||||||||||
| return ( | ||||||||||||||||||
| <> | ||||||||||||||||||
| <Touchable disabled={disabled} onPress={toggleVisibility}> | ||||||||||||||||||
| <View pointerEvents="none"> | ||||||||||||||||||
| <View style={{ pointerEvents: "none" }}> | ||||||||||||||||||
|
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. In React Native,
Suggested change
|
||||||||||||||||||
| <View | ||||||||||||||||||
| style={StyleSheet.flatten([ | ||||||||||||||||||
| styles.container, | ||||||||||||||||||
|
|
@@ -491,10 +491,10 @@ const DatePicker: React.FC<React.PropsWithChildren<Props>> = ({ | |||||||||||||||||
| // Position colored placeholder and gray placeholder on top of each other and crossfade them | ||||||||||||||||||
| // This gives the effect of animating the color, but allows us to use native driver | ||||||||||||||||||
| <View | ||||||||||||||||||
| pointerEvents="none" | ||||||||||||||||||
| style={[ | ||||||||||||||||||
| StyleSheet.absoluteFill, | ||||||||||||||||||
| { | ||||||||||||||||||
| pointerEvents: "none", | ||||||||||||||||||
|
Comment on lines
494
to
+497
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. In React Native,
Suggested change
|
||||||||||||||||||
| opacity: | ||||||||||||||||||
| // Hide the label in minimized state until we measure its width | ||||||||||||||||||
| date || focused ? (labelLayout.measured ? 1 : 0) : 1, | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -268,7 +268,7 @@ const VideoPlayer = React.forwardRef<VideoPlayerRef, VideoPlayerProps>( | |||||
| {...videoPlayerProps} | ||||||
| /> | ||||||
| {showPoster && posterSource && ( | ||||||
| <View style={StyleSheet.absoluteFill} pointerEvents="none"> | ||||||
| <View style={[StyleSheet.absoluteFill, { pointerEvents: "none" }]}> | ||||||
|
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. In React Native,
Suggested change
|
||||||
| <Image | ||||||
| source={posterSource} | ||||||
| resizeMode={posterResizeMode} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -124,11 +124,7 @@ export default class PortalHost extends React.Component<Props> { | |
| }} | ||
| > | ||
| {/* Need collapsable=false here to clip the elevations, otherwise they appear above Portal components */} | ||
| <View | ||
| style={styles.container} | ||
| collapsable={false} | ||
| pointerEvents="box-none" | ||
| > | ||
| <View style={styles.container} collapsable={false}> | ||
|
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. In React Native, |
||
| {this.props.children} | ||
| </View> | ||
| <PortalManager ref={this.setManager} /> | ||
|
|
@@ -140,5 +136,6 @@ export default class PortalHost extends React.Component<Props> { | |
| const styles = StyleSheet.create({ | ||
| container: { | ||
| flex: 1, | ||
| pointerEvents: "none", | ||
|
Comment on lines
138
to
+139
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. |
||
| }, | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,8 +44,7 @@ export default class PortalManager extends React.PureComponent<object, State> { | |
| collapsable={ | ||
| false /* Need collapsable=false here to clip the elevations, otherwise they appear above sibling components */ | ||
| } | ||
| pointerEvents="box-none" | ||
| style={StyleSheet.absoluteFill} | ||
| style={[StyleSheet.absoluteFill, { pointerEvents: "none" }]} | ||
|
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. In React Native, |
||
| > | ||
| {children} | ||
| </View> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -56,10 +56,11 @@ const Surface: React.FC<React.PropsWithChildren<Props>> = ({ | |
| ); | ||
| }; | ||
|
|
||
| const SHADOW_COLOR = "#000"; | ||
| const SHADOW_OPACITY = 0.24; | ||
|
|
||
| function shadow(elevation: number) { | ||
| function shadow( | ||
| elevation: number | ||
| ): { boxShadow: string } | Record<string, never> { | ||
|
Comment on lines
+61
to
+63
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. |
||
| if (elevation === 0) { | ||
| return {}; | ||
| } | ||
|
|
@@ -80,14 +81,7 @@ function shadow(elevation: number) { | |
| } | ||
|
|
||
| return { | ||
| shadowColor: SHADOW_COLOR, | ||
| shadowOffset: { | ||
| width: 0, | ||
| height, | ||
| }, | ||
| shadowOpacity: SHADOW_OPACITY, | ||
| shadowRadius: radius, | ||
| elevation, | ||
| boxShadow: `0px ${height}px ${radius}px rgba(0, 0, 0, ${SHADOW_OPACITY})`, | ||
| }; | ||
|
Comment on lines
83
to
85
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. Replacing the standard React Native shadow properties ( |
||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -472,10 +472,10 @@ class TextField extends React.Component<Props, State> { | |||||||||||||||||
| // Position colored placeholder and gray placeholder on top of each other and crossfade them | ||||||||||||||||||
| // This gives the effect of animating the color, but allows us to use native driver | ||||||||||||||||||
| <View | ||||||||||||||||||
| pointerEvents="none" | ||||||||||||||||||
| style={[ | ||||||||||||||||||
| StyleSheet.absoluteFill, | ||||||||||||||||||
| { | ||||||||||||||||||
| pointerEvents: "none", | ||||||||||||||||||
|
Comment on lines
475
to
+478
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. In React Native,
Suggested change
|
||||||||||||||||||
| opacity: | ||||||||||||||||||
| // Hide the label in minimized state until we measure its width | ||||||||||||||||||
| this.state.value || this.state.focused | ||||||||||||||||||
|
|
||||||||||||||||||
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.
In React Native,
pointerEventsis a component prop ofView, not a style property. Placing it inside thestyleobject will cause a runtime warning/error on native platforms (iOS/Android) stating thatpointerEventsis not a valid style property. It should be passed as a direct prop to the component instead.