vydimitrov / react-countdown-circle-timer

Lightweight React/React Native countdown timer component with color and progress animation based on SVG
MIT License
692 stars 87 forks source link

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

Closed teenageknight closed 2 years ago

teenageknight commented 2 years ago

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.

teenageknight commented 2 years ago
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

vydimitrov commented 2 years ago

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?