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

onComplete always fire when reset duration after onComplete 1st bug

nighttiger1990 opened this issue · comments

               <View style={styles.countdownContainer}>
                <CountdownCircleTimer
                  isPlaying
                  duration={countdownDuration}
                  colors={['#004777', '#F7B801', '#A30000', '#A30000']}
                  colorsTime={[300, 200, 100, 0]}
                  onComplete={finishCountdown}>
                  {({ remainingTime }) => <Text>{remainingTime}</Text>}
                </CountdownCircleTimer>
              </View>
              <Button onPress={() => setCountdownDuration(18)} title={'Reset duration'} />

After first time duration end the onComplete fire perfect, but when I click Reset duration the onComplete event always fire

My version
"react-native-countdown-circle-timer": "^3.0.9",
My react-native info

System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz
    Memory: 79.28 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 16.16.0 - ~/.nvm/versions/node/v16.16.0/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.11.0 - ~/.nvm/versions/node/v16.16.0/bin/npm
    Watchman: 2022.07.04.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 27, 28, 31
      Build Tools: 27.0.3, 28.0.3, 30.0.3, 31.0.0
      Android NDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 17.0.1 - /Users/truongbl/.jenv/shims/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.2 => 0.69.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Hey, can you do a minimum demo that reproduces the issue here?