Git Product home page Git Product logo

Comments (6)

vydimitrov avatar vydimitrov commented on July 17, 2024 3

Hey @HumayounBaig, you are at the right place. Of course you can do it .... you will need just to format the remaining time. Here is one possible solution, check the codesandbox- https://codesandbox.io/s/vigorous-easley-rh33d?file=/src/index.js

from react-countdown-circle-timer.

vydimitrov avatar vydimitrov commented on July 17, 2024 1

Sure thing, I will add a few exmaples on how to format remaining time. I am closing this issue, let me know if you need any additional help.

from react-countdown-circle-timer.

vydimitrov avatar vydimitrov commented on July 17, 2024 1

Changing the duration and initialRemainingTime is not really possible once the component is mounted because it is error-prone. One way to go around is to pass a new key prop to the component, which will cause the component to rerender and start over. You can read more here.

from react-countdown-circle-timer.

HumayounBaig avatar HumayounBaig commented on July 17, 2024 1

@vydimitrov thanks alot adding key prop did the trick for me. 👍

from react-countdown-circle-timer.

HumayounBaig avatar HumayounBaig commented on July 17, 2024

hey @vydimitrov thanks it worked great.
i'll suggest adding this example in docs would make it much easier to find.

from react-countdown-circle-timer.

HumayounBaig avatar HumayounBaig commented on July 17, 2024

thanks @vydimitrov,
one last thing i am having issue with updating the remaining time i.e. adding or removing from it. I am updating the state used for 'duration' but the timer doesn't refresh / update reflecting the updated duration state.
Is there any way to update the timer programatically.

image

from react-countdown-circle-timer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.