Custom React Hooks For Beginners with Typescript [2022]
HTML-код
- Опубликовано: 3 окт 2024
- Create your very own custom React hook.
Video Info
Music by Tesko / prod. THXMOS: / @prod.thxmos6970
Support
Like this video? You can show your support by buying me a coffee ☕❤️: www.buymeacoff...
Socials
Github: github.com/joe...
Twitter: / thenerdycanuck
About The Channel
The knowledge that I share here is mostly from my personal experiences. I wouldn't say I'm a 20 year professional, rather I am just a DevOps / Software Engineer with a lot of experience who enjoys teaching what I know in my spare time. I believe that sharing some of my basic knowledge on this platform can help others get started. There are many ways to program something and the videos you see here are my take on the NodeJS / Typescript / and sometimes Unity world. If this channel helps you learn, or helps you think differently then my job is done 😊.
#reactjs #reacthooks #typescript
Super clear, better than the other guys like Traversy
Canuck this is so freaking amazing, thank you so much for such a great explanation, I really appreciate it! Please keep doing educational videos with TS, you have the magic to explain.
Yes!
cool stuff! great explanation
Great music
Thanks for this video and good explanation.
I have a question, what if 'useFetch' can fetch both objects (one record) and arrays ? what will be the generic definition of the useFetch hook ?
Nice explanation, thanks ^_^
Should we return the data in JSON form or in array form? Example :-
(I also want to return the error if occured)
1) const { data, loading, error } = useFetch();
2) const [data, loading, error] = useFetch();
Is there a convention or good pattern on which to use?
I would do an array, but you can do json (object). Either works. And yes, you can pass the error this way :)
@@TheNerdyCanuck Thanks for the quick reply!
I just come here to listen to your voice. Also it's pronounced data
ᵖʳᵒᵐᵒˢᵐ 😁
This is a really great example, thank you. One question though..why did you put comma after the 'T' in the Generic declaration of 'useFetch' in 'useFetch.ts' ?
Might be a typo, let me look and get back to you