From 8f3494962dcca20d61faaf2d308a9d39e466c53d Mon Sep 17 00:00:00 2001 From: Lukas Baranauskas <46403446+lukebars@users.noreply.github.com> Date: Thu, 2 Jan 2020 14:03:56 +0200 Subject: [PATCH] Fix array of zeros on iOS The output of warning was being caused on every fill progress update if dash style wasn't provided so it resulted in array of eros [0,0]. `CGContextSetLineDash: invalid dash array: at least one element must be non-zero` --- src/CircularProgress.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CircularProgress.js b/src/CircularProgress.js index a0978b8..47e2e03 100644 --- a/src/CircularProgress.js +++ b/src/CircularProgress.js @@ -89,8 +89,10 @@ export default class CircularProgress extends React.PureComponent { ? dashedBackground : { width:0, gap:0 }; - const strokeDasharray = Object.values(dashedBackgroundStyle) - .map(value => parseInt(value)); + const strokeDasharray = dashedBackground.gap > 0 ? + Object.values(dashedBackgroundStyle) + .map(value => parseInt(value)) + : null; return (