From 3a1b139d15de588c064d0baf6d572b8e979ec811 Mon Sep 17 00:00:00 2001 From: ShaMan123 <34343793+ShaMan123@users.noreply.github.com> Date: Sun, 3 Jun 2018 13:55:01 +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. Commit PR for `` as well. --- elements/Polygon.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/elements/Polygon.js b/elements/Polygon.js index e3e80d89..f2f4c23a 100644 --- a/elements/Polygon.js +++ b/elements/Polygon.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() {