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:
ShaMan123
2018-06-03 13:53:46 +03:00
committed by GitHub
parent 046c7efc04
commit aaa1c3d2b7

View File

@@ -18,7 +18,14 @@ export default class extends Component {
setNativeProps = (...args) => {
//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() {