10 React Hooks Explained // Plus Build your own from Scratch

2024 ж. 2 Мам.
1 327 444 Рет қаралды

React hooks provide a highly-efficient was to tap into framework features and organize reactive logic. Learn how use every built-in React hook fireship.io/courses/react-nex...
00:00 Why React Hooks?
02:20 useState
03:50 useEffect
05:55 useContext
06:58 useRef
07:58 useReducer
09:27 useMemo
10:12 useCallback
10:40 useImperativeHandle
11:18 useLayoutEffect
11:43 useDebugValue & Custom Hooks
#webdev #js #react
Install the quiz app 🤓
iOS itunes.apple.com/us/app/fires...
Android play.google.com/store/apps/de...
Upgrade to Fireship PRO at fireship.io/pro
Use code lORhwXd2 for 25% off your first payment.
My VS Code Theme
- Atom One Dark
- vscode-icons
- Fira Code Font

Пікірлер
  • The React documentation should link to this video.

    @albirtarsha5370@albirtarsha53703 жыл бұрын
    • That google listening to your thoughts and the algo working in the background lol

      @day2dayja110@day2dayja1103 жыл бұрын
    • This channel's videos aren't beginner friendly.. It only helps people who are already familiar with this stuff.

      @TheSaintsVEVO@TheSaintsVEVO3 жыл бұрын
    • @@TheSaintsVEVO not in this case. This video is just a copy of the official (poor) docs.

      @rafadydkiemmacha7543@rafadydkiemmacha75433 жыл бұрын
    • @@TheSaintsVEVO not really. This video is much better. The docs is.. shall I say confusing

      @roy1299@roy12993 жыл бұрын
    • @@TheSaintsVEVO If you find something you dont know, research it and come back. This applies no matter what level youre at. Id say a beginner would get more out of this video than an expert.

      @jasonlough6640@jasonlough66403 жыл бұрын
  • Hours of react knowledge distilled in 10 mins. Felt like stealing. Thanks man, great work!

    @RohitSharma-vq2gn@RohitSharma-vq2gn3 жыл бұрын
    • ever noticed stolen things taste better than bought? ... except bricks... those taste the same

      @key2010@key20102 жыл бұрын
    • facts, time is money bro that's the reason and we are lazy asf

      @astrophilo2000@astrophilo20002 жыл бұрын
    • i really thought i would be learning react hooks in 1hr but this guy did in 10 mins, superb!

      @kimdev11@kimdev11 Жыл бұрын
    • nice man i still don’t get it

      @WellActualllyyy@WellActualllyyy3 ай бұрын
  • Learned more about hooks in this single video than all my attempts to learn about them over the past several years!

    @CodeSketched@CodeSketched3 жыл бұрын
    • Interesting, because this video doesn't say anything more than the official guide.

      @rafadydkiemmacha7543@rafadydkiemmacha75433 жыл бұрын
    • @@rafadydkiemmacha7543 you're right, but the official documentation never felt welcoming enough to read through all the hooks.

      @CodeSketched@CodeSketched3 жыл бұрын
    • @@CodeSketched I completely agree and in my opinion, this video is not welcoming neither. One of the worst ones so far.

      @rafadydkiemmacha7543@rafadydkiemmacha75433 жыл бұрын
    • @@rafadydkiemmacha7543 MOVE ON Hater

      @shashikanthp3145@shashikanthp31453 жыл бұрын
    • @@shashikanthp3145 so it's not allowed to express opinions anymore, sheep?

      @rafadydkiemmacha7543@rafadydkiemmacha75433 жыл бұрын
  • One thing alot of people miss is that on useState in the setter you can actually pass a function to get the prev state value you for say updating a counter which is the correct way. For example setCount(prevCount => prevCount + 1). if you where to call setCount and try modify the value based on the current count value the state would be modified based on the value at that render time. If you call setCount(count + 1) twice it would only infact increase the value by one as both calls would get the prev rendered value and overwrite each other. Hope this helps

    @ImVengeance@ImVengeance3 жыл бұрын
    • wow i knew that we should use prevcount but never truly knew what could go wrong if i didn't. Thank you man.

      @souvikchakraborty9900@souvikchakraborty99007 ай бұрын
    • aaaaaAaAaa​@@souvikchakraborty9900

      @KhiemKimDoPkmn@KhiemKimDoPkmn2 ай бұрын
  • now I'm happy that I started learning React in 2022 too lol. I just skipped this whole class thing.

    @codinginflow@codinginflow Жыл бұрын
    • same lol. Class components are so confusing to me but hooks makes it sooo much easier to understand lol.

      @thelonercoder5816@thelonercoder5816 Жыл бұрын
    • @@thelonercoder5816 haha yeah! felt good we can just skip what was a major pain in the butt for a lot of devs in the past

      @cycla@cycla Жыл бұрын
  • You explained the whole feature set of the major change React has had in years in 13 minutes! That's just unbelievably awesome! ❤️

    @AjeyChandhan@AjeyChandhan2 жыл бұрын
  • You have me *”hook”* ed to this channel.

    @usmanmir5663@usmanmir56633 жыл бұрын
    • Boooooooooooo!

      @Onserio.@Onserio.3 жыл бұрын
    • Yeeeessssssssss!

      @everythingisfine9988@everythingisfine99883 жыл бұрын
    • go ahead and clock out for me

      @jessejamison128@jessejamison1283 жыл бұрын
    • now thats how you useContext()

      @natman882001@natman8820013 жыл бұрын
    • HAHAHA bye.

      @69bruh@69bruh3 жыл бұрын
  • It is insane how well you explained all these hooks in not a lot of time without it seeming rushed/barely brushed over. Thank you!

    @djvanschaik@djvanschaik2 жыл бұрын
  • When I wanna know about a topic and fireship has already made a video about it is the best feeling. This guy can concisely teach any topic.

    @Surya-np1bb@Surya-np1bb Жыл бұрын
  • This is flawless, clear, concise, and thorough. You are an exceptional natural teacher.

    @zackyang123@zackyang1233 жыл бұрын
  • - 1:34 - Ben Awad has entered the chat

    @devsauce@devsauce3 жыл бұрын
  • The amount of information your videos consist is unbelievable, really appreciate your efforts

    @AryanLokar@AryanLokar3 жыл бұрын
  • never ever have I seen someone explaining complex things in simple and short words like you do you are a professional at explaining things

    @muhammadahmedjaved7691@muhammadahmedjaved76913 жыл бұрын
  • Wow, It was actually easy to understand the core concept of the hooks in just 10min, I have seen 40min that could not explain a hook as good as this video. Great work.

    @Jorschm@Jorschm Жыл бұрын
  • Wow, I had a really hard time figuring out precisely how hooks were working until I found this video. It's so clear and explaining the fundamentals (the key). I'm literally looking for a way to join any newsletter you have because I love the way you communicate complex principles.

    @reda_el@reda_el3 жыл бұрын
  • Well done man , I didn't expect this much clarity in just 13 minutes, but you explained everything perfectly. Thanks

    @himalayagupta7744@himalayagupta77442 жыл бұрын
  • This video is must of every react developer. He made everything so simple and easy to understand and that to about so much of react features in just 13 minutes.

    @sathkur9@sathkur92 жыл бұрын
  • you are ridiculously good at explaining things succinctly in a short amount of time - thank you for this great content.

    @ffelaar@ffelaar2 жыл бұрын
  • One of the best explanations of React Hooks. Thank you for good stuffs 👌

    @kawsar.130@kawsar.130 Жыл бұрын
  • this is the most amazing, concise, digestible video i've ever watch. Huge props!

    @s4lmon134@s4lmon1342 жыл бұрын
  • You always manage to put out a video that i just need in that exact moment. Simply amazing. Keep up the good work

    @wiz7903@wiz79033 жыл бұрын
  • It's definitely a tough chunk to digest but it's really interesting to have a peak at what react is since I always looked the other way toward angular and vue

    @williamboshi1855@williamboshi18553 жыл бұрын
  • Another awesome video. I love React hooks. I just recently started diving into writing custom hooks. It has been an excellent way to create reusable functionality as well as not stuffing all the logic in one file. Thanks for this video.

    @CodingAfterThirty@CodingAfterThirty3 жыл бұрын
  • So simple and useful! Thanks a lot for explaining these things in the most understandable manner.

    @yuliavasylenko8603@yuliavasylenko8603 Жыл бұрын
  • The great ability of high-level explanations about general and wide concepts in only 13 minutes. thank you!

    @fithamlakfikrie4657@fithamlakfikrie4657 Жыл бұрын
  • Been working with react over 9 months now, learn something new everytime I watch one of your react videos. 🤯

    @mokroargra7277@mokroargra72773 жыл бұрын
    • Bro I need some help

      @vikas7769@vikas77692 жыл бұрын
  • Love the pace you have in your videos. And the visuals is just stunnig

    @kocraft137@kocraft1373 жыл бұрын
  • This is amazingly easy to understand with just 10 minutes!! Thanks a lot great man!

    @rain-techstudio2567@rain-techstudio25672 жыл бұрын
  • This is awesome 🔥 I've been preparing myself for upcoming interviews I'm going to have and this has explained reacts hooks quite for me, it'll come in handy when asked.

    @romeopeter1922@romeopeter19222 жыл бұрын
  • For non-native English speakers, I'd recommend watching the video at 0.75 speed. Pretty dense (yet high quality) information.

    @EduardKaresli@EduardKaresli3 жыл бұрын
  • Thanks for quick but clear intro on react hooks.

    @pathumjayasuriya5902@pathumjayasuriya59023 жыл бұрын
  • This is really helpful for me. I started learning React without understanding component life cycle completely and was struggling a bit. Now I can useRef() of this video. Thanks!

    @snghnishant@snghnishant3 жыл бұрын
  • Easily the perfect mix of most informative and fun coding channel on the web.

    @elhaambasheerch7058@elhaambasheerch7058 Жыл бұрын
  • most clear, concise and simple explanation on hooks.

    @Alex-bc3xe@Alex-bc3xe Жыл бұрын
  • Wonderful information in just 10mins. You're a national treasure!!!

    @anth0ni33@anth0ni332 жыл бұрын
  • Literally researching react hooks today only for you to release this, fireship with the clutch content lol

    @kemuelcraig@kemuelcraig3 жыл бұрын
  • Awesome guide! You explained well, and took your time showing it! I like this video format better

    @caiooliveira6918@caiooliveira69183 жыл бұрын
  • Even thought I know about hooks...It's amazing that you are able to give so much value and information in such a short video...Enjoyed ever bit of it...💙

    @manibarathi08@manibarathi083 жыл бұрын
  • Really easy to understand and helps to point me in the right direction. For a problem, I was stuck on solving a UI component not updating by itself till I click on another component.

    @steelwolf180@steelwolf1802 жыл бұрын
  • Dude I'm in love with this channel, speed is perfect, finally someone who is not wasting 5 mins begging for subscribe, or speaking about his life or unrelated topics... And someone who is not writing code, testing and debugging in front of us... this is just perfect srsly... Keep up the perfect work!

    @devmeta1478@devmeta14782 жыл бұрын
  • I always come back to this video to a fast/clean explanation of react hooks ! Thanks for the content my man ! Amazing :)

    @felipecabreira4321@felipecabreira432111 ай бұрын
  • Awesome content! Would love to see a full Angular life-cycle hook video!

    @chektek_@chektek_3 жыл бұрын
  • The timing on this video... Thank you!

    @jojacvonkekebau3686@jojacvonkekebau36863 жыл бұрын
  • Awesome content!!!! Please more of this kind! Thank you so much!

    @rpf23543@rpf235439 ай бұрын
  • The best React Hooks video I've seen so far. Thank you for providing a such compelling video.

    @ryanmamboudjemtchemeu4289@ryanmamboudjemtchemeu42892 жыл бұрын
  • I just took an entire college course focused on React, and I learned way more from this video

    @n0ame1u1@n0ame1u12 жыл бұрын
  • Amazing work, learned more here than I have in years!

    @ByteBuf@ByteBuf7 ай бұрын
  • Fantastic video! This makes React so approachable. Love it

    @athreyamurali1439@athreyamurali14393 жыл бұрын
  • This is is the only video that not only cleared my hooks concept, but also shows the shortcut method to write eventhandling and state change in one line i.e. ( setNum(num+1)}>plus ) Thank you so much.

    @Technoholicplus@Technoholicplus3 жыл бұрын
  • Dude, u rock. If there a medal for crash course (just before an interview), this is it !!! I have an interview tomorrow and I just can't thank you enough for the revision material. Rock on !!

    @SportzMobile@SportzMobile7 ай бұрын
    • How did the interview go?

      @alexandergeorgesquire220@alexandergeorgesquire2202 ай бұрын
  • I am learning React and this is the video I needed

    @AbhigyanGautam@AbhigyanGautam3 жыл бұрын
  • Very easy to understand and very valuable video for beginners! Thanks man!

    @huseynfy@huseynfy2 жыл бұрын
  • This was amazing, it took me over an hour to write down the notes so much knowledge

    @McMurchie@McMurchie2 жыл бұрын
  • best of the best. I never understood each of them but now I got a grasp about it.!

    @gracewood6768@gracewood67682 жыл бұрын
  • I kinda struggled to understand how to create a custom hooks before, but now I understand it after watching your explanation thank you :)

    @wardenpataski2882@wardenpataski28823 жыл бұрын
  • This was amazing and to the point. Thank you 🙏🏻

    @hroman_codes@hroman_codes2 жыл бұрын
  • Great/quick explanations of each hook, super helpful thanks

    @ejthecollector@ejthecollector10 ай бұрын
  • My god, you explained the concepts and more in much better fashion than toiling over the docs for a week

    @FaruhPaerhati@FaruhPaerhati2 жыл бұрын
  • Niiice another concise hook video in plain english. This is why this is my favourite dev channel 👍🏻👌🏻

    @Chrisknot94@Chrisknot943 жыл бұрын
  • Great tutorial! Super clean and concise.

    @brittmcginnis4001@brittmcginnis40013 жыл бұрын
  • It's so amazing how this guy can pack so much data into such a small video.. respect. Great video 😍😍

    @vikram87in@vikram87in2 жыл бұрын
  • This is literally the best youtube channel I have every found. THANK YOU!

    @nikosroom1913@nikosroom1913 Жыл бұрын
  • i was here to revise my concepts and you got it all covered in 13mins , thanks a lot .!!

    @ombhagwani7407@ombhagwani74076 ай бұрын
  • brilliant to watch just before a interview :)

    @amarmohammed5644@amarmohammed5644 Жыл бұрын
  • In addition to the *useImperativeHandle* hook: you can use this if you have both a *forwardRef* and a *useRef* in your component that you want both to be assign to the same element. You can use the *useImperativeHandle* hook to assign the regular *useRef* ref to the *forwardRef* ref. This is because you can't assign two refs to the same element.

    @nukemonk@nukemonk3 жыл бұрын
  • Excellent video! I appreciate very much for the commitment to share such useful information 🙌

    @mfranciscoarrigoni@mfranciscoarrigoni3 жыл бұрын
  • I'd love to see a video comparing web component abstractions like litelement vs. frameworks (or libraries) like Angular and React.

    @yonoseespanol@yonoseespanol3 жыл бұрын
  • You completed the 3 months topic in few minutes . Great work 👏

    @MrRAHUL7777777@MrRAHUL77777772 ай бұрын
  • Many videos I saw but this one is simple specific and easy to understand… thanks

    @gautampatadiya6096@gautampatadiya60962 жыл бұрын
  • this is so detail, thanks!

    @eryetchen2667@eryetchen26673 жыл бұрын
  • Amazing!

    @JamesQQuick@JamesQQuick2 жыл бұрын
  • Thanks for the Video. I know now that i will stay with Svelte.

    @remofischer4969@remofischer49693 жыл бұрын
  • Omg, today i was thinking of reviewing react hooks and this video show up, thanks!

    @sebastiancordoba437@sebastiancordoba4373 жыл бұрын
    • same tho...

      @edwardarinin9678@edwardarinin96783 жыл бұрын
    • Lol.... same!!!

      @irfanshaik1302@irfanshaik13023 жыл бұрын
  • This is really makes the reactive feature looks very easy, thanks :)

    @Skalexsong@Skalexsong3 жыл бұрын
  • I have watched this like 17 times and I’m learning each time again lol thank you

    @slimzztv9963@slimzztv99632 жыл бұрын
  • Thanks ! This is so comprehensive and entertaining.

    @harikrishnanmidhun1644@harikrishnanmidhun16446 ай бұрын
  • Super clear and easy to follow. Thanks mate

    @ozchinesefriendship4316@ozchinesefriendship43162 жыл бұрын
  • I have never used React before, and this video has made me that much more comfortable sticking with Vue 😅

    @mattshnoop@mattshnoop3 жыл бұрын
    • Hooks are beautiful. I have projects using both react and vue, both are awesome. I'm a react guy and i think it's easy to learn Vue if you already on intermediate level in React. But I don't know the learning curve if you learn Vue first.

      @degitgitagitya9473@degitgitagitya94733 жыл бұрын
  • Excellent content, thank you for sharing your knowledge .

    @josephuwagwu3069@josephuwagwu30693 жыл бұрын
  • short and simple explaination that's what devs want. this is just that.

    @tarunkr5352@tarunkr5352 Жыл бұрын
  • Love the videos dude, especially how they have a certain flow to them, it would be super interesting if you could make a video on you making one of your normal tutorials??

    @dannyman2200@dannyman22003 жыл бұрын
  • This comes at the right moment - thanks man!

    @ALbertoDoriguzzi@ALbertoDoriguzzi3 жыл бұрын
  • You youtube channel is simply dream come true for a developer. Short videos, great explanations, etc. It is just awesome

    @programmingpython584@programmingpython584 Жыл бұрын
  • thank you for these clear explanations

    @gokhanunal71@gokhanunal713 жыл бұрын
  • For the work you do, I love you Jeff ❤️

    @koka6414@koka64143 жыл бұрын
  • Very crisp and precise as always 👌👌

    @ujjwalchetan4907@ujjwalchetan49072 жыл бұрын
  • I stumbled on this video but I’m glad I did! I was looking for ways to implement hooks in my program but had no idea what to do with them. When I watched this video I had a “Oh, THAT’S what it does” moment occur multiple times. Thanks for making this!

    @hobbiesandmore5633@hobbiesandmore56332 жыл бұрын
  • Where was this video a year ago!!!!!! EXCELLENT!!!!!! 10000/10

    @day2dayja110@day2dayja1103 жыл бұрын
  • Sick video! Looking forward to the next js with firebase guide.

    @Chaaos2@Chaaos23 жыл бұрын
  • Short & Helpful, I like it

    @javadmh7827@javadmh78272 жыл бұрын
  • I watched hours video for understanding React Hooks. This video did unbelievable, so easy, just 13 minutes. Thank you from Azerbaijan.

    @snansahmarov1524@snansahmarov15243 жыл бұрын
  • Every second is worth watching this channel.❤️

    @shaheenumar4926@shaheenumar49263 жыл бұрын
  • This is actually a great video. Thank you!

    @franciscogilt@franciscogilt2 жыл бұрын
  • Maan! I love taking tour in your channel you deliver clean and conscious contents.

    @3mro_coding@3mro_coding2 жыл бұрын
  • srsly your content is insane man. thank you thank you thank you

    @kurtthorsten4463@kurtthorsten44632 жыл бұрын
  • A video about React Native! And Compare it with Flutter.

    @usmanmir5663@usmanmir56633 жыл бұрын
    • He actually has one created.

      @monfernape@monfernape3 жыл бұрын
  • This is the only video i have found helpful. it's been a week and i have been struggling with react hooks. I am used to writing classes. Hooks feel very intimidating to me but after watching this video, i feel confident in using hooks instead of writing classes. Thank you for such an easy explanation

    @zarghamaijaz5933@zarghamaijaz59333 жыл бұрын
    • Glad it helped!

      @Fireship@Fireship3 жыл бұрын
  • Excellent video on React Hooks.

    @emstudios14@emstudios142 жыл бұрын
  • This is some amazing work you have done!

    @KaleemKhan-uf4fb@KaleemKhan-uf4fb2 жыл бұрын
  • 1:34 (best framework ever) - I just can't agree more :)

    @ali-celebi@ali-celebi3 жыл бұрын
    • LOL

      @pradeepsaravanan4348@pradeepsaravanan43482 жыл бұрын
KZhead