mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 07:59:28 +00:00
clear up propTypes
This commit is contained in:
@@ -3,22 +3,19 @@ import React, {
|
||||
PropTypes
|
||||
} from 'react-native';
|
||||
import Path from './Path';
|
||||
import {pathProps} from '../lib/props';
|
||||
|
||||
class Polyline extends Component{
|
||||
static displayName = 'Polyline';
|
||||
static propTypes = {
|
||||
points: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
strokeLinecap: PropTypes.oneOf(['butt', 'square', 'round']),
|
||||
strokeCap: PropTypes.oneOf(['butt', 'square', 'round']),
|
||||
strokeLinejoin: PropTypes.oneOf(['miter', 'bevel', 'round']),
|
||||
strokeJoin: PropTypes.oneOf(['miter', 'bevel', 'round'])
|
||||
...pathProps,
|
||||
points: PropTypes.string
|
||||
};
|
||||
static getPath = props => (`M${props.points.trim().replace(/\s+/g, 'L')}`);
|
||||
|
||||
render() {
|
||||
return <Path
|
||||
{...this.props}
|
||||
d={Polyline.getPath(this.props)}
|
||||
d={`M${this.props.points.trim().replace(/\s+/g, 'L')}`}
|
||||
/>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user