React Hooks Tutorial - 32 - useCounter Custom Hook

preview_player
Показать описание

📱 Follow Codevolution

useCounter Custom Hook in React
Рекомендации по теме
Комментарии
Автор

I am following this Tutorial from 1 year and no one can beat this guy, for making concepts simple and clean even an infant can understand.

Devendrakr
Автор

Wow, Simple, concise, and fully understandable, Thank you.

Mohamed-M-M
Автор

I the way you explain things with simple examples. Thank you very much!!

iuliiasiriakivska
Автор

I love this tutorial, The way he explained is very simple and understandable. :)

sathiyanathjuttusahadevan
Автор

In some kind of way hooks uses the principle of closure.

antoinemondoloni
Автор

Creating and using a more substantial Custom Hook in React, so clearly explained. Thanks, Vishwas.

{2024-09-23}

Pareshbpatel
Автор

Thank you for the series✓, Vishwas :-)

peddivarunkumar
Автор

You are awesome. Please one video on JavaScript closure with real life example. 😀

Ghummakad_bhaya
Автор

So hooks are basically reusable javascript functions?

backseatgaming
Автор

very nice explanation, I just have a doubt. can you tell me why don't you use callback in this exercise?
is it just because the goal of the exercise?.
can I add useCallback as refactor?.
How to know when to use setState(newState) instead of useState(prevState => newState)?.

joseferneymedinaserrato
Автор

so dont this have the same funcionality of a HOC?

DESCEREBRADOStv
Автор

Amazing, excellent content mate, thanks! Do you have any thoughts on how could we make the count persistent, let say to count the number of visitors on a blog article.

nicolaycamacho
Автор

useCounter custom hook looks like a normal js function in a separate file with return values. then why we are calling it custom hooks. can plz explain it.

MrRajeshyada
Автор

Thank you very much for these tuts, they're superb!
In this particular case I'm getting the next error:

Uncaught TypeError: (intermediate value)(...) is not iterable

And it's related to the assignment:

const [count, increment, decrement, reset] = useCounter(0);

My project was created using standard React blueprint with Vite JS, so it uses .jsx extension but everything else (at first sight) is the same as the one created by "npx create-react-app".
Any help will be welcomed!
PS: Sorry for my English, I'm a Spanish native ;)

guillermohinostroza
Автор

by the way, where did "prevCount" come from, it doesn't even declared anywhere,
you declare "count" and "setCount" but not "prevCount"

is "prev" somehow is a react defined magic word too?

jensenraylight
Автор

wow 0 dislikes and 1k like! this is the first time see in my youtube history

muslimf
Автор

It's better return an object like this: `return {count, increment, decrement, reset}`...

valp_co
Автор

At 2:05 why did you not used () => increment() on onClick???

umarjaved
Автор

can you make an example on how to breakdown useReducer into custom hook

Alex-xebl
Автор

Again the first to comment on this tutorial, I guess !!! Really well explained tutorial on the how to write reusable code using custom hooks !!! Thx !!!

jagdishshetty
join shbcf.ru