[add] Support for Schema prop types

View and Text forward Schema prop types to host DOM node.
https://schema.org/docs/gs.html

Fix #1247
This commit is contained in:
Nicolas Gallagher
2019-03-07 10:50:34 -08:00
parent 63868b492d
commit 34427897f3
3 changed files with 32 additions and 15 deletions
@@ -24,13 +24,17 @@ const TextPropTypes = {
nativeID: string,
numberOfLines: number,
onBlur: func,
onContextMenu: func,
onFocus: func,
onLayout: func,
onPress: func,
selectable: bool,
style: StyleSheetPropType(TextStylePropTypes),
testID: string
testID: string,
// web extensions
onContextMenu: func,
itemprop: string,
itemscope: string,
itemtype: string
};
export default TextPropTypes;
+23 -13
View File
@@ -43,7 +43,6 @@ export type ViewProps = {
onBlur?: Function,
onClick?: Function,
onClickCapture?: Function,
onContextMenu?: Function,
onFocus?: Function,
onLayout?: (event: ViewLayoutEvent) => void,
onResponderGrant?: Function,
@@ -67,6 +66,11 @@ export type ViewProps = {
pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto',
style?: stylePropType,
testID?: string,
// web extensions
onContextMenu?: Function,
itemprop?: string,
itemscope?: string,
itemtype?: string,
// compatibility with React Native
accessibilityViewIsModal?: boolean,
collapsable?: boolean,
@@ -84,17 +88,19 @@ const ViewPropTypes = {
accessibilityLabel: string,
accessibilityLiveRegion: oneOf(['assertive', 'none', 'polite']),
accessibilityRole: string,
accessibilityStates: arrayOf(oneOf([
'disabled',
'selected',
/* web-only */
'busy',
'checked',
'expanded',
'grabbed',
'invalid',
'pressed'
])),
accessibilityStates: arrayOf(
oneOf([
'disabled',
'selected',
/* web-only */
'busy',
'checked',
'expanded',
'grabbed',
'invalid',
'pressed'
])
),
accessibilityTraits: oneOfType([array, string]),
accessible: bool,
children: any,
@@ -104,7 +110,6 @@ const ViewPropTypes = {
onBlur: func,
onClick: func,
onClickCapture: func,
onContextMenu: func,
onFocus: func,
onLayout: func,
onMoveShouldSetResponder: func,
@@ -128,6 +133,11 @@ const ViewPropTypes = {
pointerEvents: oneOf(['auto', 'box-none', 'box-only', 'none']),
style: stylePropType,
testID: string,
// web extensions
onContextMenu: func,
itemprop: string,
itemscope: string,
itemtype: string,
// compatibility with React Native
accessibilityViewIsModal: bool,
collapsable: bool,
@@ -58,6 +58,9 @@ const supportedProps = {
// unstable escape-hatches for web
className: true,
href: true,
itemprop: true,
itemscope: true,
itemtype: true,
onClick: true,
onClickCapture: true,
rel: true,