Advanced React Context Typescript | useContext and createContext

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

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

  • @aleksandarpanov1385
    @aleksandarpanov1385 15 дней назад

    Wow! You nailed it. Great tutorial. I liked it. Saved it. Subscribed to the channel.

  • @deathdefier45
    @deathdefier45 10 месяцев назад

    Clean to the point explanation, thank you for helping me visualise the data changes so clearly, great tutorial!

  • @fatinfuyad2816
    @fatinfuyad2816 9 месяцев назад

    Very important video. I was looking for context with tsx

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

    And with 30 minutes of my time I now have a context wrapped around my tricky filter UI and wiped out half the JS in that component. Many thanks.

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

    Amazing example ! Thanks very much ! I have implement this to my context and it work nicely!

  • @biLLie_wiLLie
    @biLLie_wiLLie 2 года назад +2

    19:05 with cmd + D it's faster to achieve) Thank you for lesson

  • @starlodroid2778
    @starlodroid2778 11 месяцев назад

    Man you helped me very much!Thanks

  • @АндрейЯландаев
    @АндрейЯландаев Месяц назад

    Мужик! Ты лучший!

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

    u answered all my questions!

  • @dananjayachathuranga7113
    @dananjayachathuranga7113 11 месяцев назад

    finally found a clear video

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

    how do you mock this hook for jest testing?

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

    thanks for the video, very usefull !

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

    Great video but a lot of this is confusing to me.
    In the first case where there's no useEffect I couldn't understand why the useMemo in the context did the trick. After all, if the button is pressed then a new object should be generated despite the useMemo because the state has changed and the useMemo dependency array has this element.
    Yet, the Laser component didn't re-render. Any idea about the reason?

    • @Weibenfalk
      @Weibenfalk  2 года назад +2

      It’s the first context that changes value. Not the second one. That’s why it’s the same object when it’s memoized

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

      @@Weibenfalk oh man, how did I miss that!

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

    Hej Thomas, lärorik video, har du någon video som du går genom lite djupt på hur man skickar State mellan olika component på en nested state data i ReactJS och TypeScript?

    • @Weibenfalk
      @Weibenfalk  Год назад +1

      Hej ... hmmm .. vet inte riktigt hur du menar. State skickar man aldrig utan man skickar data via props till komponenterna. Annars är det context man kör med och då kan man accessa statet vartsomhelst i appen.

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

      @@Weibenfalk Jo jag vet, det jag vill göra är, jag har tre comp, Home.tsx där jag fetchar en lokal nested json fil sedan definierar interfaces för dessa nested data, efter jag gör map på datan och skickat en del över till GameList.tsx, samtidigt skickar jag en del av state över till Search.tsx som filtrering på game titel sker, sedan vill jag sätta den filtrerade data på State och skickar tillbaka till Home.tsx som är Parent comp, men jag får en Typescript error mer specifikt STATE