mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-19 04:28:00 +00:00
33 lines
1.0 KiB
JavaScript
33 lines
1.0 KiB
JavaScript
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
import * as React from 'react';
|
|
import Path from './Path';
|
|
import Shape from './Shape';
|
|
import extractPolyPoints from '../lib/extract/extractPolyPoints';
|
|
export default class Polyline extends Shape {
|
|
static displayName = 'Polyline';
|
|
static defaultProps = {
|
|
points: ''
|
|
};
|
|
setNativeProps = props => {
|
|
const {
|
|
points
|
|
} = props;
|
|
if (points) {
|
|
props.d = `M${extractPolyPoints(points)}`;
|
|
}
|
|
this.root && this.root.setNativeProps(props);
|
|
};
|
|
render() {
|
|
const {
|
|
props
|
|
} = this;
|
|
const {
|
|
points
|
|
} = props;
|
|
return /*#__PURE__*/React.createElement(Path, _extends({
|
|
ref: this.refMethod,
|
|
d: points && `M${extractPolyPoints(points)}`
|
|
}, props));
|
|
}
|
|
}
|
|
//# sourceMappingURL=Polyline.js.map
|