Type useContext : React and TypeScript

Поделиться
HTML-код
  • Опубликовано: 28 ноя 2024

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

  • @mr.cpeguero
    @mr.cpeguero 2 года назад +1

    useContext starts around 8:45

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

    Thank you so much! Keep it going!

  • @_sumitdey.exe1
    @_sumitdey.exe1 3 года назад +2

    Hey I have a doubt.. which initial value ultimately gets set in the context.. the value you passed inside createContext(VALUE) or the value you passed as the initial value in reducer

  • @nicklimajs
    @nicklimajs 3 года назад +1

    Parabéns pelo vídeo Atila. Ótimo conteúdo!

    • @AtilaDotIO
      @AtilaDotIO  3 года назад

      Valeu, Nick!!!
      Tentando melhorar a cada vídeo! 🔥

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

    He is too smooth, I just don't understand how does he not fall into any of them typescript pits like I do =) I almost regret my project uses typescript now..

  • @Shakeel714
    @Shakeel714 3 года назад +1

    Clear and easy-to-understand explanation. Very helpful. Thanks so much Atila. Please keep creating more such tutorial videos on React-Typescript.

    • @AtilaDotIO
      @AtilaDotIO  3 года назад

      Thanks a lot, Shakeel!! I'm very happy you're liking the videos.
      Comments like yours are what gets me going! 💪

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

    Is Typescript mainly geared towards larger applications? It seems like a lot of extra work to make this simple counting machine.

  • @PabloGeokar
    @PabloGeokar 3 года назад

    Show de bola Atila, está mandando ver no inglês também

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

    Thanks alot for this great video. Need more videos on react with typescript
    Kindly share the repo.

  • @GabrielPereira-hd8tc
    @GabrielPereira-hd8tc 3 года назад

    Continuing typescript series! pls!!! tks mano!

  • @margo2328
    @margo2328 3 года назад

    Agree with the tricky parts and quite nasty pitfalls. Is it also the same when using TypeScript in Angular or just React? OOP in C# feels so natural and works like a breeze.

  • @declanarkins3987
    @declanarkins3987 3 года назад +1

    Getting errors in context.tsx: Binding element 'ReactNode' implicitly has an 'any' type. Cannot find name 'children'. ReactNode is defined but never used.

  • @hypealex
    @hypealex 3 года назад

    meow! :) thanks with the wonderful tutorial

  • @grahampcharles
    @grahampcharles 3 года назад +1

    I'm using your code exactly and on line 29 getting a TypeScript error: Type '{ state: { count: number; }; dispatch: React.Dispatch; }' is not assignable to type 'undefined'.ts(2322). Any thoughts?

    • @AtilaDotIO
      @AtilaDotIO  3 года назад +2

      Hello, Graham
      sorry I was not able to reproduce the error, I'm guessing the file you're mentioning the error is the `context.tsx`, right?
      If that's so, I just uploaded my code to a Github public gist:
      gist.github.com/atilafassina/02f9826c473130b162bea5783373dfdd
      If that doesn't help, please let me know.
      I will upload the code from every video to a github repository ASAP, I just hadn't had time to set everything up just yet.
      Cheers!

    • @AyKayGod
      @AyKayGod 3 года назад +1

      You need to add the type of state and dispatch as :
      `createContext(undefined);`

    • @WilCODE_
      @WilCODE_ 3 года назад

      @@AyKayGod in an interface how would it be?

  • @hoangtu77
    @hoangtu77 3 года назад

    What is the color themes and font bro ?

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

    Nice tutorial, but did I just hear gun shot @7:25

  • @SkillTrailMalefiahs
    @SkillTrailMalefiahs 3 года назад

    Excelent!!!

  • @ashwinnair9862
    @ashwinnair9862 3 года назад

    Why did it not ask for type for [children} while defining the context provider?

  • @rohitgulati394
    @rohitgulati394 3 года назад

    The glass at 9:36 :')

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

    half of tutorial is css ....

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

      Thanks for the feedback, Kosta :)
      I usually don't like skipping parts that affect the UI I'm showing. That's why I added the landmarks on the video description.

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

      half of all tutorials are css. Just skip it.