Today I found a good use case for react hooks. I needed a way to execute a function every 10 seconds. So, I used a custom hook called useInterval, which can be found on npm as “use-interval”. Works super well. Just pass it a function and the delay and bang. After the component unmounts the interval clears 😊
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.