mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-07 08:45:00 +00:00
update setNativeProps
When updating `points` prop, `setNativeProps` must send a valid `d` prop to `this.root` which is a `<Path>'. It needs more work, couldn't get it working perfectly. I'm new to RN. Will commit PR for `<Polygon>` as well.
This commit is contained in:
@@ -18,7 +18,14 @@ export default class extends Component {
|
|||||||
|
|
||||||
setNativeProps = (...args) => {
|
setNativeProps = (...args) => {
|
||||||
//noinspection JSUnresolvedFunction
|
//noinspection JSUnresolvedFunction
|
||||||
this.root.getNativeElement().setNativeProps(...args);
|
var points = [...args][0].points;
|
||||||
|
if (points) {
|
||||||
|
if (Array.isArray(points)) {
|
||||||
|
points = points.join(",");
|
||||||
|
}
|
||||||
|
[...args][0].d = `M${extractPolyPoints(points)}`
|
||||||
|
}
|
||||||
|
this.root.setNativeProps(...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
Reference in New Issue
Block a user