From aaa1c3d2b725e1cf5987c769f6b28ad77e4b4990 Mon Sep 17 00:00:00 2001 From: ShaMan123 <34343793+ShaMan123@users.noreply.github.com> Date: Sun, 3 Jun 2018 13:53:46 +0300 Subject: [PATCH] update setNativeProps When updating `points` prop, `setNativeProps` must send a valid `d` prop to `this.root` which is a `'. It needs more work, couldn't get it working perfectly. I'm new to RN. Will commit PR for `` as well. --- elements/Polyline.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/elements/Polyline.js b/elements/Polyline.js index 9e7ad87b..2edb67cd 100644 --- a/elements/Polyline.js +++ b/elements/Polyline.js @@ -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() {