mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-03 07:06:04 +00:00
clear up propTypes
This commit is contained in:
+4
-3
@@ -3,18 +3,19 @@ import React, {
|
||||
PropTypes
|
||||
} from 'react-native';
|
||||
import Path from './Path';
|
||||
import {pathProps} from '../lib/props';
|
||||
|
||||
class Polygon extends Component{
|
||||
static displayName = 'Polygon';
|
||||
static propTypes = {
|
||||
points: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
|
||||
...pathProps,
|
||||
points: PropTypes.string
|
||||
};
|
||||
static getPath = props => (`M${props.points.trim().replace(/\s+/g, 'L')}z`);
|
||||
|
||||
render() {
|
||||
return <Path
|
||||
{...this.props}
|
||||
d={Polygon.getPath(this.props)}
|
||||
d={`M${this.props.points.trim().replace(/\s+/g, 'L')}z`}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user