How do I access the API methods? #145
-
Hello, I'm trying to write helper functions to set the timer for certain increments of time (15s, 30s, 1min, etc) and then start the timer from there (or start the timer once the timer has been set to a value). How do I utilize the start(), pause(), stop() etc methods? For reference, this is the base helper function for setting to a time value:
Here is an example function for setting to fifteen seconds:
I feel like I'm missing something obvious, as I haven't gotten the methods to work. Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello, and sorry for my late response. I've updated the API section https://github.com/ndresx/react-countdown#api-reference to include an example. Hopefully, this still helps someone. |
Beta Was this translation helpful? Give feedback.
-
can this be done using functional components? all i want to access is the start function |
Beta Was this translation helpful? Give feedback.
Hello, and sorry for my late response. I've updated the API section https://github.com/ndresx/react-countdown#api-reference to include an example. Hopefully, this still helps someone.