[fix] ignore more native-only View/Text props

Fix #735
Close #753
This commit is contained in:
Maxime Thirouin
2018-01-08 16:22:06 +01:00
committed by Nicolas Gallagher
parent 17614e348b
commit fd6ccbcfb3
3 changed files with 28 additions and 7 deletions
+4
View File
@@ -49,7 +49,11 @@ class Text extends Component<*> {
lineBreakMode, lineBreakMode,
minimumFontScale, minimumFontScale,
onLayout, onLayout,
onLongPress,
pressRetentionOffset,
selectionColor,
suppressHighlighting, suppressHighlighting,
textBreakStrategy,
/* eslint-enable */ /* eslint-enable */
...otherProps ...otherProps
} = this.props; } = this.props;
+20 -7
View File
@@ -38,14 +38,11 @@ export type ViewProps = {
accessibilityTraits?: string | Array<string>, accessibilityTraits?: string | Array<string>,
accessible?: boolean, accessible?: boolean,
children?: any, children?: any,
collapsable?: boolean,
hitSlop?: EdgeInsetsProp, hitSlop?: EdgeInsetsProp,
importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants', importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants',
onAccessibilityTap?: Function,
onClick?: Function, onClick?: Function,
onClickCapture?: Function, onClickCapture?: Function,
onLayout?: (event: ViewLayoutEvent) => void, onLayout?: (event: ViewLayoutEvent) => void,
onMagicTap?: Function,
onResponderGrant?: Function, onResponderGrant?: Function,
onResponderMove?: Function, onResponderMove?: Function,
onResponderReject?: Function, onResponderReject?: Function,
@@ -65,9 +62,17 @@ export type ViewProps = {
onTouchStart?: Function, onTouchStart?: Function,
onTouchStartCapture?: Function, onTouchStartCapture?: Function,
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto', pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto',
removeClippedSubviews?: boolean,
style?: stylePropType, style?: stylePropType,
testID?: string testID?: string,
// compatibility with React Native
accessibilityViewIsModal?: boolean,
collapsable?: boolean,
needsOffscreenAlphaCompositing?: boolean,
onAccessibilityTap?: Function,
onMagicTap?: Function,
removeClippedSubviews?: boolean,
renderToHardwareTextureAndroid?: boolean,
shouldRasterizeIOS?: boolean
}; };
const ViewPropTypes = { const ViewPropTypes = {
@@ -78,7 +83,6 @@ const ViewPropTypes = {
accessibilityTraits: oneOfType([array, string]), accessibilityTraits: oneOfType([array, string]),
accessible: bool, accessible: bool,
children: any, children: any,
collapsable: bool,
hitSlop: EdgeInsetsPropType, hitSlop: EdgeInsetsPropType,
importantForAccessibility: oneOf(['auto', 'no', 'no-hide-descendants', 'yes']), importantForAccessibility: oneOf(['auto', 'no', 'no-hide-descendants', 'yes']),
onClick: func, onClick: func,
@@ -104,7 +108,16 @@ const ViewPropTypes = {
onTouchStartCapture: func, onTouchStartCapture: func,
pointerEvents: oneOf(['auto', 'box-none', 'box-only', 'none']), pointerEvents: oneOf(['auto', 'box-none', 'box-only', 'none']),
style: stylePropType, style: stylePropType,
testID: string testID: string,
// compatibility with React Native
accessibilityViewIsModal: bool,
collapsable: bool,
needsOffscreenAlphaCompositing: bool,
onAccessibilityTap: func,
onMagicTap: func,
removeClippedSubviews: bool,
renderToHardwareTextureAndroid: bool,
shouldRasterizeIOS: bool
}; };
export default ViewPropTypes; export default ViewPropTypes;
+4
View File
@@ -40,11 +40,15 @@ class View extends Component<ViewProps> {
const { const {
hitSlop, hitSlop,
/* eslint-disable */ /* eslint-disable */
accessibilityViewIsModal,
collapsable, collapsable,
needsOffscreenAlphaCompositing,
onAccessibilityTap, onAccessibilityTap,
onLayout, onLayout,
onMagicTap, onMagicTap,
removeClippedSubviews, removeClippedSubviews,
renderToHardwareTextureAndroid,
shouldRasterizeIOS,
/* eslint-enable */ /* eslint-enable */
...otherProps ...otherProps
} = this.props; } = this.props;