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`
This commit is contained in:
Lukas Baranauskas 2020-01-02 14:03:56 +02:00 committed by GitHub
parent 993059ebc7
commit 8f3494962d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 (
<View style={style}>