Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useCountdown Hook #70

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

useCountdown Hook #70

wants to merge 22 commits into from

Conversation

ndresx
Copy link
Owner

@ndresx ndresx commented Dec 27, 2019

Changelog

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

Enhancements

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

@coveralls
Copy link

coveralls commented Dec 27, 2019

Coverage Status

coverage: 100.0%. remained the same
when pulling ab7a310 on use-countdown-hook
into 4e76783 on master.

@ndresx ndresx added dependencies Pull requests that update a dependency file documentation enhancement labels Dec 28, 2019
@SalahAdDin
Copy link

@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.

@ndresx
Copy link
Owner Author

ndresx commented Mar 16, 2020

@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!

@SalahAdDin
Copy link

👍

@kishoretankhupp
Copy link

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

@ndresx
Copy link
Owner Author

ndresx commented Jan 12, 2021

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

@SalahAdDin
Copy link

@ndresx We are still waiting for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file documentation enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants