React useEffect Hook tutorial | Learn ReactJS

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ •

  • @DaveGrayTeachesCode
    @DaveGrayTeachesCode  3 роки тому +5

    The React useEffect hook is frequently applied in React applications, but it is important to understand when it will run before you apply it to your application. You can also accidentally create an endless loop with useEffect if you do not understand how it may impact the state of your application. In this tutorial, we review how to apply useEffect, when useEffect will run, and what to avoid when applying useEffect. If you are just starting out with Javascript, I recommend beginning with my full 8 hour tutorial for beginners here: ua-cam.com/video/EfAl9bwzVZk/v-deo.html

  • @vincentiusherie
    @vincentiusherie 3 роки тому +5

    I've watched numerous tutorials on useEffect (and ReactJS in general). Yours is and are the best. Very very clear. i don't think this tutorial is a "how to" for beginners because it is comprehensive. But the way you explained it is so easy to understand. Many many thanks for your videos. They're absolutely brilliant! You are a great communicator!

  • @keepanopenmindlookatallthe2540
    @keepanopenmindlookatallthe2540 3 роки тому +1

    I've spent days trying to read and learn about incorporating setInterval within useEffect, useState and useRef.
    This made it VERY clear how it works

  • @CodeWithTomi
    @CodeWithTomi 3 роки тому +1

    You're dropping some great contents.... Love the react series

  • @muhammedozalp
    @muhammedozalp Рік тому

    Neat and clean explanation of useEffects. Thanks bro

  • @fernandosalas4885
    @fernandosalas4885 2 роки тому

    Best useEffect() tutorial all over the web!

  • @MrSalFav
    @MrSalFav Рік тому

    Thank you Dave !! Really appreciate the tutorials you make they are one of the best.

  • @spiritual5750
    @spiritual5750 2 роки тому

    Dave you are godsend honestly.

  • @ghostpieces2362
    @ghostpieces2362 3 роки тому

    The before and after example was brilliant and probably where I would have struggled with how useEffect works. Thank

  • @blaircfleming
    @blaircfleming 3 роки тому

    Great content Dave, keep it coming!

  • @aya2222
    @aya2222 2 роки тому +3

    I watched your javascript, and advanced javascript tutorials and jumped into react several days ago after I finished freecodecamp react tutorial. Now, I grasped the concept of useEffect and got 'aha' moment. Thank you so much for being wonderful teacher and dedicating your time and talent to make awesome tutorials.

  • @mhideout5856
    @mhideout5856 2 роки тому

    Exactly what I needed... Thanks a ton

  • @harag9
    @harag9 Рік тому

    Great video, many thanks.

  • @julianblanco7604
    @julianblanco7604 Рік тому

    Great video, ¿you have to add the setState in the dependencies, the enlist gives me a warning that setState is missing?

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  Рік тому

      Newer versions of React should not give that warning. Older versions of React did give that warning and you will see me add it in this series due to that. However, you are not required to add the setState function to the dependencies. React "knows" it will not change.

  • @tuanphamvan655
    @tuanphamvan655 2 роки тому

  • @nahidfaraji5069
    @nahidfaraji5069 2 роки тому

    Top-notch content. Thank You so much

  • @jamshidtashkent1976
    @jamshidtashkent1976 2 роки тому

    good explanation. thanx

  • @andrews13
    @andrews13 Рік тому

    Always perfect!

  • @worldclasscode1847
    @worldclasscode1847 2 роки тому

    Great video! :)

  • @replayzor
    @replayzor 2 роки тому

    I deleted the whole thing because of that error min 8:50 =)) and started over . I deleted the localstorage by mistake in the 9th video tutorial. Now I know why i got the error || [] :)) sad day for me

  • @skillkrio
    @skillkrio 2 роки тому

    Dave in the timeframe 06.10, you are setting the items from the localStorage and the initial value is empty array. I am just wondering how it worked on your pc because when i console the localstorage the value is null if there are no localstorage created. once the component finishes its execution it executes our useEffect and trigger the setItems(here value is null from shoppinglist). This cause App to re-render because our Items have been updated from [ ] to null. This causes error. But the second way is working fine. Is that edge-case that you forgot or am i doing wrong.

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 роки тому +1

      I believe if you continue to the next lesson (or two), you will see I provide the short circuit operator to setState to either the data-fill array OR an empty array. Keep going :)

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 роки тому

    Awesome Tutorial +++++++++++++++++++++ Thank You

  • @Hashir-704
    @Hashir-704 3 місяці тому

    brilliant

  • @immortalaigs4203
    @immortalaigs4203 2 роки тому

    Still not understand why we use useeffect.?????

    • @DaveGrayTeachesCode
      @DaveGrayTeachesCode  2 роки тому

      "The Effect Hook lets you perform side effects in function components." More details in the docs: reactjs.org/docs/hooks-effect.html

  • @BharatRasoi
    @BharatRasoi 3 роки тому

    Nice👌

  • @psyferinc.3573
    @psyferinc.3573 2 роки тому

    yass use effect

  • @TravinskiyVladislav
    @TravinskiyVladislav 2 роки тому

    Comment to top

  • @ruslangilyazov7733
    @ruslangilyazov7733 7 місяців тому

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 роки тому

    Awesome Tutorial +++++++++++++++++++++ Thank You

  • @mohamedyoussef8835
    @mohamedyoussef8835 2 роки тому

    Awesome Tutorial +++++++++++++++++++++ Thank You