Skip to content

Commit fd6ccbc

Browse files
MoOxnecolas
authored andcommitted
[fix] ignore more native-only View/Text props
Fix #735 Close #753
1 parent 17614e3 commit fd6ccbc

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

packages/react-native-web/src/exports/Text/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ class Text extends Component<*> {
4949
lineBreakMode,
5050
minimumFontScale,
5151
onLayout,
52+
onLongPress,
53+
pressRetentionOffset,
54+
selectionColor,
5255
suppressHighlighting,
56+
textBreakStrategy,
5357
/* eslint-enable */
5458
...otherProps
5559
} = this.props;

packages/react-native-web/src/exports/View/ViewPropTypes.js

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,11 @@ export type ViewProps = {
3838
accessibilityTraits?: string | Array<string>,
3939
accessible?: boolean,
4040
children?: any,
41-
collapsable?: boolean,
4241
hitSlop?: EdgeInsetsProp,
4342
importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants',
44-
onAccessibilityTap?: Function,
4543
onClick?: Function,
4644
onClickCapture?: Function,
4745
onLayout?: (event: ViewLayoutEvent) => void,
48-
onMagicTap?: Function,
4946
onResponderGrant?: Function,
5047
onResponderMove?: Function,
5148
onResponderReject?: Function,
@@ -65,9 +62,17 @@ export type ViewProps = {
6562
onTouchStart?: Function,
6663
onTouchStartCapture?: Function,
6764
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto',
68-
removeClippedSubviews?: boolean,
6965
style?: stylePropType,
70-
testID?: string
66+
testID?: string,
67+
// compatibility with React Native
68+
accessibilityViewIsModal?: boolean,
69+
collapsable?: boolean,
70+
needsOffscreenAlphaCompositing?: boolean,
71+
onAccessibilityTap?: Function,
72+
onMagicTap?: Function,
73+
removeClippedSubviews?: boolean,
74+
renderToHardwareTextureAndroid?: boolean,
75+
shouldRasterizeIOS?: boolean
7176
};
7277

7378
const ViewPropTypes = {
@@ -78,7 +83,6 @@ const ViewPropTypes = {
7883
accessibilityTraits: oneOfType([array, string]),
7984
accessible: bool,
8085
children: any,
81-
collapsable: bool,
8286
hitSlop: EdgeInsetsPropType,
8387
importantForAccessibility: oneOf(['auto', 'no', 'no-hide-descendants', 'yes']),
8488
onClick: func,
@@ -104,7 +108,16 @@ const ViewPropTypes = {
104108
onTouchStartCapture: func,
105109
pointerEvents: oneOf(['auto', 'box-none', 'box-only', 'none']),
106110
style: stylePropType,
107-
testID: string
111+
testID: string,
112+
// compatibility with React Native
113+
accessibilityViewIsModal: bool,
114+
collapsable: bool,
115+
needsOffscreenAlphaCompositing: bool,
116+
onAccessibilityTap: func,
117+
onMagicTap: func,
118+
removeClippedSubviews: bool,
119+
renderToHardwareTextureAndroid: bool,
120+
shouldRasterizeIOS: bool
108121
};
109122

110123
export default ViewPropTypes;

packages/react-native-web/src/exports/View/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,15 @@ class View extends Component<ViewProps> {
4040
const {
4141
hitSlop,
4242
/* eslint-disable */
43+
accessibilityViewIsModal,
4344
collapsable,
45+
needsOffscreenAlphaCompositing,
4446
onAccessibilityTap,
4547
onLayout,
4648
onMagicTap,
4749
removeClippedSubviews,
50+
renderToHardwareTextureAndroid,
51+
shouldRasterizeIOS,
4852
/* eslint-enable */
4953
...otherProps
5054
} = this.props;

0 commit comments

Comments
 (0)