vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation does not show the correct way to pass in multiple colors

teenageknight opened this issue · comments

This package, when passing in multiple colors, either takes in one string representing that color or an array of color tuples. If you run the code as-is, you get a null pointer exception, as seen in the picture.

import { CountdownCircleTimer } from 'react-native-countdown-circle-timer'

const UrgeWithPleasureComponent = () => (
  <CountdownCircleTimer
    isPlaying
    duration={7}
    colors={['#004777', '#F7B801', '#A30000', '#A30000']}
    colorsTime={[7, 5, 2, 0]}
  >
    {({ remainingTime }) => <Text>{remainingTime}</Text>}
  </CountdownCircleTimer>
)

This is what i was talking about

Hey @teenageknight, it seems to be working fine, you can check it in this Snack. Can you reproduce your issue in Expo Snack and share a link?