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

Комментарии • 14

  • @ToddDunning
    @ToddDunning 2 года назад +1

    Super clear, better than the other guys like Traversy

  • @daromacs
    @daromacs 2 года назад

    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.

  • @igordztv
    @igordztv 2 года назад +1

    Yes!

  • @TESKOmakesmusic
    @TESKOmakesmusic 2 года назад +1

    cool stuff! great explanation

  • @djameldahmoun8672
    @djameldahmoun8672 Год назад

    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 ?

  • @Lotpite
    @Lotpite 2 года назад

    Nice explanation, thanks ^_^

  • @paritoshbatish9984
    @paritoshbatish9984 2 года назад +1

    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?

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 года назад +1

      I would do an array, but you can do json (object). Either works. And yes, you can pass the error this way :)

    • @paritoshbatish9984
      @paritoshbatish9984 2 года назад

      @@TheNerdyCanuck Thanks for the quick reply!

  • @marks4910
    @marks4910 2 года назад +1

    I just come here to listen to your voice. Also it's pronounced data

  • @blainekoch1265
    @blainekoch1265 2 года назад +1

    ᵖʳᵒᵐᵒˢᵐ 😁

  • @cliffvbajo
    @cliffvbajo 2 года назад

    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' ?

    • @TheNerdyCanuck
      @TheNerdyCanuck  2 года назад

      Might be a typo, let me look and get back to you