add touchableProps and responderProps into propTypes

This commit is contained in:
Horcrux
2016-06-09 23:35:08 +08:00
parent 67b8b0c96f
commit dba1fb2801
6 changed files with 10 additions and 11 deletions

View File

@@ -2,15 +2,13 @@ import React, {PropTypes} from 'react';
import createNativeComponent from '../lib/createNativeComponent';
import Shape from './Shape';
import mergeContext from '../lib/mergeContext';
import {circleProps, pathProps, fillProps, strokeProps, numberProp, touchableProps, responderProps} from '../lib/props';
import {circleProps, pathProps, fillProps, strokeProps, numberProp} from '../lib/props';
class Circle extends Shape {
static displayName = 'Circle';
static propTypes = {
...pathProps,
...circleProps,
...touchableProps,
...responderProps
...circleProps
};
static contextTypes = {

View File

@@ -1,6 +1,6 @@
import React, {PropTypes} from 'react';
import createNativeComponent from '../lib/createNativeComponent';
import {numberProp} from '../lib/props';
import {numberProp, touchableProps, responderProps} from '../lib/props';
import Shape from './Shape';
import resolveAssetSource from 'react-native/Libraries/Image/resolveAssetSource';
@@ -12,7 +12,9 @@ class Image extends Shape {
y: numberProp,
width: numberProp,
height: numberProp,
href: PropTypes.number.isRequired
href: PropTypes.number.isRequired,
...responderProps,
...touchableProps
//preserveAspectRatio: PropTypes.string
};

View File

@@ -6,7 +6,7 @@ class Polygon extends Component{
static displayName = 'Polygon';
static propTypes = {
...pathProps,
points: PropTypes.string
points: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
};
render() {

View File

@@ -6,7 +6,7 @@ class Polyline extends Component{
static displayName = 'Polyline';
static propTypes = {
...pathProps,
points: PropTypes.string
points: PropTypes.oneOfType([PropTypes.string, PropTypes.array])
};
render() {

View File

@@ -13,8 +13,6 @@ class Text extends Shape {
dx: numberProp,
dy: numberProp,
...textProps,
...fillProps,
...strokeProps,
...pathProps
};

View File

@@ -76,7 +76,8 @@ const pathProps = {
...strokeProps,
...clipProps,
...transformProps,
...responderProps
...responderProps,
...touchableProps
};
const circleProps = {