Giter Site home page Giter Site logo

react-use-count-down's People

Contributors

alexkhismatulin avatar dependabot[bot] avatar matalmeida avatar toruticas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

react-use-count-down's Issues

DeprecationWarning: Invalid 'main' field

Hello,
I'm using nextjs@^13.5.4 and react-countdown-hook@^1.1.3
Some warnings printed in terminal when i try to build my app:

  Collecting page data  ..(node:121361) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121371) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
   Collecting page data  ...(node:121568) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121538) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121411) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121588) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121578) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121421) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121481) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121401) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121461) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121508) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
 โœ“ Collecting page data    
   Generating static pages (0/56)  [    ](node:121451) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
   Generating static pages (2/56)  [=   ] 
(node:121381) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121431) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121492) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:121471) [DEP0128] DeprecationWarning: Invalid 'main' field in '/SOME_DIRECTORIES/frontend/node_modules/react-countdown-hook/package.json' of 'dist/index.js'. Please either fix that or report it to the module author

Can you help to resolve warnings?

Countdown status

It could be great to have tome insight on the countdown, ot be aware if it's running, paused, completed/finished.

On expire functionality

Hi)
Thank you for a nice and clean lib.
I have a question/proposal for you. How is it supposed to be used to run some logic at the end of the timer? For example I need to trigger log out when timeLeft === 0, but it's a default value. Maybe it's better if timeLeft would be not equal zero by default on start/restart but to equal initialTime? Or maybe you're working on some kind of onExpire callback?

initial state should not be '0'

const [timeLeft, setTimeLeft] = React.useState(0);
Here,initial state should not be '0',use the argus 'timeToCount' is more better.
cause ,'0' is the mark of the beginning and the end,Can cause initialization rendering problems

package.json fields references wrong files

The published version has flattened file structure, which means the references to source, main, module, unpkg in package.json are wrong, leading to problems with bundlers using those fields (e.g. vite).

v1.1.3
v1 1 3

v1.1.1
v1 1 1

Add typescript definitions

Currently none available

$ yarn add @types/react-countdown-hook
yarn add v1.22.10
[1/4] ๐Ÿ”  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@types%2freact-countdown-hook: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/cypressf/repos/aniguesser/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

Feature to cleanup the countdown

Right now I in my cleanup I just pause the timer. I was wondering if this was enough or there was a cleanup function I could when my component unmounts.

Countdown stops counting when the tab is not active

If the countdown starts on a tab and you switch to another in the browser, it stops counting.

This behaviour is seen on chrome.

I tried it also in edge, it also stops counting there but accelerates when the tab is active to reach the count where it should be.

Support react 18

Hi.
Do you have plans for supporting react 18 and update the peerDependency?

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.