fix View propTypes

This commit is contained in:
Nicolas Gallagher
2016-07-10 14:23:05 -07:00
parent 79998e0acc
commit f15bf2664a
+12 -7
View File
@@ -1,5 +1,6 @@
import applyNativeMethods from '../../modules/applyNativeMethods' import applyNativeMethods from '../../modules/applyNativeMethods'
import createNativeComponent from '../../modules/createNativeComponent' import createReactDOMComponent from '../../modules/createReactDOMComponent'
import EdgeInsetsPropType from '../../propTypes/EdgeInsetsPropType'
import normalizeNativeEvent from '../../modules/normalizeNativeEvent' import normalizeNativeEvent from '../../modules/normalizeNativeEvent'
import { Component, PropTypes } from 'react' import { Component, PropTypes } from 'react'
import StyleSheet from '../../apis/StyleSheet' import StyleSheet from '../../apis/StyleSheet'
@@ -8,13 +9,15 @@ import ViewStylePropTypes from './ViewStylePropTypes'
class View extends Component { class View extends Component {
static propTypes = { static propTypes = {
accessibilityLabel: createNativeComponent.propTypes.accessibilityLabel, accessibilityLabel: createReactDOMComponent.propTypes.accessibilityLabel,
accessibilityLiveRegion: createNativeComponent.propTypes.accessibilityLiveRegion, accessibilityLiveRegion: createReactDOMComponent.propTypes.accessibilityLiveRegion,
accessibilityRole: createNativeComponent.propTypes.accessibilityRole, accessibilityRole: createReactDOMComponent.propTypes.accessibilityRole,
accessible: createNativeComponent.propTypes.accessible, accessible: createReactDOMComponent.propTypes.accessible,
children: PropTypes.any, children: PropTypes.any,
hitSlop: EdgeInsetsPropType,
onClick: PropTypes.func, onClick: PropTypes.func,
onClickCapture: PropTypes.func, onClickCapture: PropTypes.func,
onLayout: PropTypes.func,
onMoveShouldSetResponder: PropTypes.func, onMoveShouldSetResponder: PropTypes.func,
onMoveShouldSetResponderCapture: PropTypes.func, onMoveShouldSetResponderCapture: PropTypes.func,
onResponderGrant: PropTypes.func, onResponderGrant: PropTypes.func,
@@ -35,7 +38,7 @@ class View extends Component {
onTouchStartCapture: PropTypes.func, onTouchStartCapture: PropTypes.func,
pointerEvents: PropTypes.oneOf(['auto', 'box-none', 'box-only', 'none']), pointerEvents: PropTypes.oneOf(['auto', 'box-none', 'box-only', 'none']),
style: StyleSheetPropType(ViewStylePropTypes), style: StyleSheetPropType(ViewStylePropTypes),
testID: createNativeComponent.propTypes.testID testID: createReactDOMComponent.propTypes.testID
}; };
static defaultProps = { static defaultProps = {
@@ -50,6 +53,8 @@ class View extends Component {
render() { render() {
const { const {
hitSlop, // eslint-disable-line
onLayout, // eslint-disable-line
pointerEvents, pointerEvents,
style, style,
...other ...other
@@ -80,7 +85,7 @@ class View extends Component {
] ]
} }
return createNativeComponent(props) return createReactDOMComponent(props)
} }
/** /**