How to use the higher order component in a functional component? #268
-
Hello - I installed v5 and I would like to use it as I did with the v4 one. Your examples on how to use the IIdleTimer interface are only with class based components. Can you please show how to do that with functional component as well? thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Have you checked out the docs site? https://idletimer.dev You can start here https://idletimer.dev/docs/getting-started/new to see whats new from v4 and then check out https://idletimer.dev/docs/api/use-idle-timer for a sample hook implementation. I do plan on doing some code sandbox examples, but work has been pretty busy lately. Hoping to be able to get to it soon. The docs page itself uses a hook. It's a pretty complex implementation, but you could take a look there as well if you like. https://github.com/SupremeTechnopriest/react-idle-timer/blob/master/docs/pages/demo.tsx. If you have some specific questions feel free to drop them here and I will do my best to answer them, but you should be able to use v5 the same way as v4 if you are using the |
Beta Was this translation helpful? Give feedback.
Hi @ofirTelecareBill!
Have you checked out the docs site? https://idletimer.dev
You can start here https://idletimer.dev/docs/getting-started/new to see whats new from v4 and then check out https://idletimer.dev/docs/api/use-idle-timer for a sample hook implementation. I do plan on doing some code sandbox examples, but work has been pretty busy lately. Hoping to be able to get to it soon. The docs page itself uses a hook. It's a pretty complex implementation, but you could take a look there as well if you like. https://github.com/SupremeTechnopriest/react-idle-timer/blob/master/docs/pages/demo.tsx.
If you have some specific questions feel free to drop them here and I will do my best to an…