react-countdown icon indicating copy to clipboard operation
react-countdown copied to clipboard

useCountdown Hook

Open ndresx opened this issue 6 years ago • 11 comments

Changelog

  • [x] Updated documentation
  • [x] Updated React peer dependencies to >= 16.8.0 for Hook support
  • [x] Deprecated children prop in favor of the renderer prop
  • [x] Removed standard <span /> output for React Native compatibility (results in removed className support)
  • [x] Updated and refactored existing typings
  • [x] Updated examples
  • [x] Migrated to ESLint

Enhancements

  • [x] Added useCountdown Hook 🎣
  • [x] Added pure prop for better clarity of prop changes
  • [x] Added milliseconds to time delta information

ndresx avatar Dec 27 '19 12:12 ndresx

Coverage Status

Coverage remained the same at 100.0% when pulling 91fe1e6ff0b779ad1540d328f567344825f5635c on use-countdown-hook into c909d9746bc79cdc9b8866d98284b0256d643a1a on master.

coveralls avatar Dec 27 '19 12:12 coveralls

@ndresx Do you have any plan to release this?

I'm having problems to use the start() function as i explained before in other issue, now i'm trying to get the api() from the render but i can't:

const Timer = ({ hours, minutes, seconds, completed, props }) => {
  const { className, renderer } = props;
  let time = completed ? `Is completed!` : `${hours}:${minutes}:${seconds}`;
  console.log('====================================');
  console.log(renderer.api.start());
  console.log('====================================');
  return (
    <StepLabel
      alternativeLabel
      StepIconComponent={StepIcon}
      StepIconProps={{
        classes: {
          root: className
        },  
        icon: time
      }}
    />
  );
};

render.api is undefined, getting api from props gives me the same result, i don't know what is the problem.

Thanks.

SalahAdDin avatar Mar 16 '20 10:03 SalahAdDin

@SalahAdDin I have, but I am still working and tweaking some things. I have posted a possible solution into the other issue thread, please take a look at the provided code there; I hope it helps!

ndresx avatar Mar 16 '20 17:03 ndresx

:+1:

SalahAdDin avatar Oct 14 '20 20:10 SalahAdDin

@ndresx Any plan on this to merged in master so we can use it in react-native as well.

kishoretankhupp avatar Dec 21 '20 12:12 kishoretankhupp

@kishoretankhupp Yes, but it, unfortunately, might still take a bit until then. I hope I can wrap it up soon though!

ndresx avatar Jan 12 '21 23:01 ndresx

@ndresx We are still waiting for this.

SalahAdDin avatar Mar 05 '21 09:03 SalahAdDin