refactor Components props extracting

This commit is contained in:
Horcrux
2017-02-03 19:43:25 +08:00
parent 9b62d500ce
commit 5bd9b40c17
35 changed files with 208 additions and 276 deletions
+6 -9
View File
@@ -1,14 +1,13 @@
import {Component, PropTypes} from 'react';
import {numberProp} from '../lib/props';
let propType = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
class Pattern extends Component{
export default class extends Component{
static displayName = 'Pattern';
static propTypes = {
x1: propType,
x2: propType,
y1: propType,
y2: propType,
x1: numberProp,
x2: numberProp,
y1: numberProp,
y2: numberProp,
patternTransform: PropTypes.string,
patternUnits: PropTypes.oneOf(['userSpaceOnUse', 'objectBoundingBox']),
patternContentUnits: PropTypes.oneOf(['userSpaceOnUse', 'objectBoundingBox'])
@@ -19,5 +18,3 @@ class Pattern extends Component{
return null;
}
}
export default Pattern;