React Hook Challenge: Custom Countdown Timer - Junior Level!

preview_player
Показать описание
In this custom react hook, we'll incorporate best practices of writing react hooks in practically coding out our own useCountdown hook. This beginner / junior level react challenge is great if you are getting started with React or NextJS and would like to expand your knowledge on hooks. Hooks are amazing for abstracting core logic to then be able to use them across different components or even projects!

I got the idea for this challenge from here:

Thanks for watching, if you have improvements for the hook be sure to comment them below so everyone can benefit!
Рекомендации по теме
Комментарии
Автор

Dude I am absolutely in for this video 😂😂😂 let me do my own

codewithguillaume
Автор

we can do it without giving time in dependency array as setTime is calling the effect again and again

priyasuryawanshi
Автор

Thanks, Josh! Very helpful!

General question: Why is it that "time" is always printed twice to the console? Because the printing is triggered by the useEffect and also the useState because "time" is a state?

Gruß aus Aachen!

cryptofelix
Автор

Al compilar una app en nextjs, me pidió agregar el callback y el interval como parámetro del useEffect
When compiling an app in nextjs, it asked me to add the callback and the interval as a useEffect parameter

peluka
Автор

O hellow!
Will it be something about NEXT 13?

CTILET
welcome to shbcf.ru