The useMemo hook in React | Sigma Web Development Course - Tutorial

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

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

  • @prasenjitnayak_
    @prasenjitnayak_ 9 месяцев назад +29

    useMemo is like a notepad that React uses to store the result of a function. If the inputs to that function remain the same, React just reads the result from the notepad instead of redoing the calculation. This helps improve performance by avoiding unnecessary recalculations.

    • @GameVerb1
      @GameVerb1 8 месяцев назад +2

      How is it any different from useEffect then?

    • @SwatejTech
      @SwatejTech 6 месяцев назад

      @@GameVerb1 useEffect is completely different.
      useEffect is used to run a piece of code at various points of React life cycle (when a component is mounted, updated, un mounted etc..).
      Where as useMemo is used to store the result of the function with certain inputs which are then used to reduce the time required to run the code when the same function is called with the same inputs.

    • @supremeleader5516
      @supremeleader5516 5 месяцев назад

      @@SwatejTech life cycle kaha se padhe aapne? harry ne to shayad nhi padhaye

    • @Newone-io6og
      @Newone-io6og 2 месяца назад

      @@SwatejTech bhai useEffect ko sirf ek baar chalaye to result to same hi aayega na??

    • @chandreshsolanki7580
      @chandreshsolanki7580 2 месяца назад

      ​@@Newone-io6ogHa wahi to use effect ki dependency me agar humne numbers likh diya to wo to ek he baar chalega mujhe bhi yahi doubt hai

  • @Abhishek12762
    @Abhishek12762 9 месяцев назад +17

    You are great Harry bhai ❤ . Those you are providing us are the most valuable comparison to others. I had bought a web development course but your free course is so amazing and I have left that paid course and joined your amazing playlist. I have completed all html & css classes and now entering your javascript 56 video. thanks so much harry bhai ❤

    • @vishvjeetmore7532
      @vishvjeetmore7532 8 месяцев назад

      If there is Expensive competition in React App, If we do something change like count change, React App Re-Renders, So also Expensive competition run again and again, If We wanna stop Expensive competition For No Lagging in React App, The solution is (useMemo) #Harry Ki Train 🚂🚋🚃🚋🚃🚋🚃 Kab Rukegi ❤❤😂😂😂 Jamin Ke Kagaj Bheje hai, Ghar Wale Puchh rha hai, Ghar to Nahi Becha tune 😂😂😂❤❤❤❤

    • @VishvjeetTag8091
      @VishvjeetTag8091 8 месяцев назад

      In 30 million my Laptop 💻 was Not working 👨‍💻 and warmth like 💥😂😂😂😂😂

    • @supremeleader5516
      @supremeleader5516 5 месяцев назад

      @@VishvjeetTag8091 kisne bola tha bund panga lene ko

  • @MudassirKhan-mi8vu
    @MudassirKhan-mi8vu 9 месяцев назад +8

    You're a great teacher, just don't stop the course till it's end because there is always that one student waiting for the other video so that he can make his career. And these videos will grow for sure. Love From Pakistan ❤️❤️(YOUR OLDEST SUBSCRIBER, WATCHING YOU FROM A LONG TIME)

  • @itsMohak
    @itsMohak 9 месяцев назад +3

    Absolutely stunning and phenomenal

  • @Amardeep-Singh-d4z
    @Amardeep-Singh-d4z 6 дней назад +1

    Sir aapne kaha useMemo Tricky hai par aapne samjhaya to yesa laga nahi ki ye tricky hai.
    Thanks for best explanation.

  • @AshutoshKrSingh-w6v
    @AshutoshKrSingh-w6v 8 месяцев назад

    Really appreciate the work you have done for the developer community. Never found this quality of video on the internet. The way you teach is really exceptional.

  • @Rahulkumar-zf4rl
    @Rahulkumar-zf4rl 9 месяцев назад +1

    really is vide me usememo bahut easy way me samjhaya gya h mujhe sirf ek baar video dkhne se hi samjh aa gya.

  • @ankitmatade4710
    @ankitmatade4710 9 месяцев назад +3

    This course is much better than any other paid course bahoot se course liya maine par aisa content nhi mila

    • @FarazAhmadDev
      @FarazAhmadDev 9 месяцев назад +1

      Bro chai aur code pe jao phr ptta chle ga

    • @ankitmatade4710
      @ankitmatade4710 9 месяцев назад +1

      @@FarazAhmadDev waha se aya hu bhai

  • @arafatrahman8494
    @arafatrahman8494 9 месяцев назад +2

    You are great Harry bhai . Those you are providing us are the most valuable comparison to others. I had bought a web development course but your free course is so amazing and I have left that paid course and joined your super amazing playlist. I have completed all videos. thanks so much harry bhai #harryBhai

  • @MuhammadAmir-fj8yu
    @MuhammadAmir-fj8yu 7 месяцев назад +1

    Thanks for the video.
    Tip: This can also be done using useEffect and a new state of magical variable, with dependency as numbers. But useMemo is better in this situation.

    • @chandreshsolanki7580
      @chandreshsolanki7580 2 месяца назад

      But magical number aur count ek he component Mai hai to use effect se bhi component pura render hoga he na?

  • @aer0449
    @aer0449 9 месяцев назад +2

    Harry Bhai ki videos ki quality is superb

  • @AashishKumar-vb3qb
    @AashishKumar-vb3qb 29 дней назад

    Harry bhai be like : "Jo dimaag mein , wo mooh par " .😃😃.Lots of love harry bhai , thanks for helping .

  • @kishorkumarmali1851
    @kishorkumarmali1851 3 месяца назад

    great explanation, struggling to understand for long time by reading docs, but this explanation was legend, Thanks

  • @IqraMubeen.sheikh
    @IqraMubeen.sheikh 9 месяцев назад +3

    You are the best coding teacher

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

      ​@@huehue..
      DUAALLAH US MAQSAD PY JIOON JISPY TUNY BHEJA HY

  • @arpitshukla-zt9bp
    @arpitshukla-zt9bp 9 месяцев назад +2

    The best coding teacher ever 😍😍 #ReactOp

  • @sufiyanmogal1527
    @sufiyanmogal1527 4 месяца назад +1

    memo is like a cache we stored result of a function and if the input is same in the next call the stored result is shown and if the input changes then it recalculate and store, so, it used for optimization

  • @sumittiwari231
    @sumittiwari231 2 месяца назад

    kuxh bhi dekh lo knhi se bhi dekh lo lekin ek baar code with harry ke paas aana hi padega

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

    #ReactOp ❤
    Very helpful course bhaiya
    You not know how many siblings are watching your course for achieving their goals

  • @Deepak.Kumar.Mahanta
    @Deepak.Kumar.Mahanta 8 месяцев назад +1

    thanks Harry Bhai🚀🚀🚀🚀🚀🚀🚀🚀 love from 📍Odisha

  • @MaazAhmed-g3m
    @MaazAhmed-g3m 2 месяца назад

    Best Course 5 out of 5🙅

  • @AZCodez
    @AZCodez 3 месяца назад +1

    7:25 useMemo hero entry

  • @notoppergamers1510
    @notoppergamers1510 9 месяцев назад +1

    Sigma Batch Op😂😂🔥🔥❤❤🔥🔥🤞🤞

  • @kushiksahu1983
    @kushiksahu1983 23 дня назад

    Basically it's dynamic programming in react.

  • @nithenbains
    @nithenbains 4 месяца назад +1

    Amamzing Lecture

  • @shantanu_saraf
    @shantanu_saraf 7 дней назад

    great explanation sir

  • @aryansinha1818
    @aryansinha1818 8 месяцев назад

    *Mainn aapko explain karunga aap tension mat lena* Thank you big brother. Love and respect. Always.

  • @DEVstyle-je1bf
    @DEVstyle-je1bf 9 месяцев назад +4

    In ayodhya

  • @suhaib_nisar
    @suhaib_nisar 8 месяцев назад

    5-6 days k baad aaj pda mujai exams chal rahay ae 12th board isse leyai ab usmai time dena pdta ae zyada ab In Shaa Allah exams k baad se phrse continue achay se pduga love from Kashmir

  • @adeelnadeem5913
    @adeelnadeem5913 9 месяцев назад +2

    sir great love from me ,
    i have learned from you so much and now im teaching as well

  • @AsmitaSinha-o9e
    @AsmitaSinha-o9e 9 месяцев назад

    This time Harry bhai is like:- Jitna Aata hai sab sikha dunga pro nahi piro-fes-nal bana Dunga....

  • @rakeshsahu27
    @rakeshsahu27 8 месяцев назад

    IsMagical: I === 9999900
    Ismagical is set TRUE on these stage already
    Then we check memo where we getting true
    Hope it should help

  • @deveshtembheker1315
    @deveshtembheker1315 4 месяца назад

    Dhanywaad Guru.....❤

  • @sufiyanmogal1527
    @sufiyanmogal1527 4 месяца назад

    Big O(n) time and space Complexity

  • @Hafijur0211
    @Hafijur0211 8 месяцев назад

    🎯 Key Takeaways for quick navigation:
    00:21 *🎥 Introduction to the useMemo hook in React*
    - Introduction to the useMemo hook in React, which is often confusing for developers.
    - Opening code and discussing the useMemo hook in React.
    00:50 *🛠️ Understanding the basic usage of useMemo*
    - Demonstrating the basic usage of useMemo with a simple counter app.
    - Starting the server and explaining the basic counter app functionality.
    01:18 *🔍 Explaining useMemo with an extreme example*
    - Explaining useMemo with an extreme example involving intense computational tasks.
    - Creating a large array and filling it with data.
    02:13 *✨ Using useMemo with a magical number*
    - Implementing useMemo with a condition based on a magical number.
    - Demonstrating the behavior of useMemo with a specific condition.
    03:19 *🧠 Understanding the `useMemo` hook in React*
    - Explaining the basic use of `useMemo`.
    - Demonstrating the comparison of numbers and filtering numbers.
    - Showing the use of the `find` method to find a specific number in an array.
    04:12 *📝 Implementing `useMemo` in React components*
    - Implementing `useMemo` to avoid expensive computations.
    - Using `useMemo` to find a specific number in an array.
    - Demonstrating how changing a state triggers re-rendering of the component.
    05:34 *💻 Avoiding unnecessary re-renders with `useMemo`*
    - Discussing the high computational cost of checking every element in an array.
    - Showing the repeated re-rendering caused by changing a count state.
    - Highlighting the need to prevent unnecessary re-renders in components.
    06:30 *🧠 The useMemo hook in React*
    - Explanation of useMemo hook and its purpose,
    - How to use useMemo to memoize expensive computations in React components.
    07:11 *🚀 Using useMemo in React components*
    - Syntax and usage of the useMemo hook,
    - Preventing expensive computations between component re-renders by memoizing values.
    08:10 *💡 Benefits of using useMemo*
    - Avoiding unnecessary re-computation of values,
    - Improving performance by caching expensive computations.
    09:33 *🔄 useMemo hook in React*
    - useMemo hook in React allows you to memoize the value and recalculate it only when necessary.
    10:15 *🔄 Optimize expensive computations with useMemo*
    - useMemo can optimize expensive computations by memoizing values and recalculating only when dependencies change, preventing unnecessary re-renders in React components.
    11:37 *🔄 Example of useMemo usage*
    - Demonstrates how to use useMemo to optimize a counter application, updating the "magic" value only when the count changes, leading to smoother application performance without unnecessary re-renders.
    12:45 *🔄 Understanding when to use useMemo*
    - useMemo is useful for optimizing expensive computations in React by memoizing values and recalculating them only when dependencies change, preventing unnecessary re-renders.
    13:27 *🔄 Example of incorrect useMemo usage*
    - Demonstrates a scenario where incorrect usage of useMemo leads to an application re-rendering unnecessarily, causing performance issues and incorrect behavior.
    Made with HARPA AI

  • @everydaywithshivam
    @everydaywithshivam 4 месяца назад

    harry bhai always rocks

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

    Great it is useful for optimising website 👍😯

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

    Sigma batch OP
    React js OP

  • @BHARATKUMAR-dk1ij
    @BHARATKUMAR-dk1ij 4 месяца назад

    Awesome explanation

  • @riteshkumarrai5349
    @riteshkumarrai5349 9 месяцев назад +1

    Mujhe ab tak react mai sab samajh mai aa gaya but router mai dikkat ho raha, mujhe detail mai router sikhna hai😅

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

    #React Op #SigmaBatchop Best teacher of coding on RUclips

  • @microsoftian
    @microsoftian 6 месяцев назад

    #CodeWithHarry rocks & #ReactBatchOP rocks 🤟👍

  • @amanasrani6405
    @amanasrani6405 2 месяца назад +1

    In the particular case you explained, i guess useEffect hook will also the same functionality naa?

  • @victorb22622
    @victorb22622 7 месяцев назад

    10:55 आखिरकार इस वीडियो भी छोड़नी पड़ी ।

  • @markiV643
    @markiV643 2 месяца назад

    sigma batch op>>

  • @swarupdas4114
    @swarupdas4114 3 месяца назад

    useMemo op
    harry bhai double op

  • @ngxlerate
    @ngxlerate 3 месяца назад

    UseMemo is some what like UseEffect

  • @Apex-i8j
    @Apex-i8j 9 месяцев назад

    React Op Love you Harry bhai❤❤

  • @RehmanKhan-ok9sg
    @RehmanKhan-ok9sg 9 дней назад

    it can be used in ecommerce app

  • @codeByteLH
    @codeByteLH 8 месяцев назад +1

    Coincidence share I am writing the code with Harry Bhai and I also and I also created 30 million size of array and when I reload the page i e the localhost server my laptop got crashed and nothing is working on my laptop for 3 to 4 minutes so if you are using any low end PC or low end laptop then don't write 30 million size of arrayit can cause is your laptop or pc

  • @MuhammadAqib0987
    @MuhammadAqib0987 7 месяцев назад +1

    React js op

  • @salonikasera6283
    @salonikasera6283 9 месяцев назад +1

    Thnx brother

  • @DEVstyle-je1bf
    @DEVstyle-je1bf 9 месяцев назад +2

    Sir come to ayodhya🎉🎉 please sir

  • @aadityaagarwal6342
    @aadityaagarwal6342 7 месяцев назад

    eid mubarak

  • @AN_Bhagat
    @AN_Bhagat 8 месяцев назад

    #SigmaBatchOp
    #ReactOp
    #Harry sir❤❤

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

    Sigmabatch Op ❤

  • @shortsviral359
    @shortsviral359 9 месяцев назад +1

    Sir is course mai approximately kitne videos honge please reply 🙏🙏🙏🙏
    #sigmabatchop
    #harrybhai

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

    #ReactOp ❤#SigmaBatchOp
    Please dont get demotivate with the current views you are getting. People will watch this series in the future. Please add next js in the series

  • @zaykaFood7
    @zaykaFood7 9 месяцев назад +1

    #Doubt
    Hii, Thank you for your amazing tutorials ,
    Is it necessary to install express every time whenever we create new file?

  • @AnasKureshi313
    @AnasKureshi313 Месяц назад

    Harry Bhai Op in the chat

  • @Shabareesha
    @Shabareesha 6 месяцев назад

    well explained

  • @Cheshta1010
    @Cheshta1010 9 месяцев назад +1

    Sir Flutter and Dart language pe videos share kar do...✅👍

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

    Sir plz algo trading par ek playlist bana do

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

    Sir algorithm trading par bi ek play list bana do sir

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

    React OP !

  • @SaketK11
    @SaketK11 9 месяцев назад +26

    Use react in thumbnail for more views

    • @shubhtalk7073
      @shubhtalk7073 5 месяцев назад

      WHAT?

    • @yusrax3
      @yusrax3 3 месяца назад

      ​@@shubhtalk7073he is asking him to write "React" in the thumbnail to get more attention

    • @shubhtalk7073
      @shubhtalk7073 3 месяца назад

      @@yusrax3 ok

  • @harshitshesh6027
    @harshitshesh6027 5 месяцев назад

    kya program tha laptop hang badi mushkil se chala h laptop but maja aa gya

  • @Noob-be3dg
    @Noob-be3dg 4 месяца назад

    Memo se dsa ki yaad agai🥲

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

    React OP!!

  • @devanshupadhyay2658
    @devanshupadhyay2658 8 месяцев назад

    Bhaiya Mai Bhaiya HArry bhaiya

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

    Sigma batch op

  • @SarbJeet-js8tl
    @SarbJeet-js8tl 9 месяцев назад

    Harry Bhai op❤❤❤❤

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

    Kaash mai ek software developer hota 😢😢

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

    sir please iske bad next js padhana

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

    React Op ❤

  • @technicalwork616
    @technicalwork616 4 месяца назад

    Did you face any problem while shooting intro

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

    आपका Computer तो बहुत fast है।

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

    Dude please make a video on moviepy

  • @RajuSingh-fl8rk
    @RajuSingh-fl8rk 7 месяцев назад

    thanks

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

    Yesterday I was facing rerender 4 time at once maybe it's help me

  • @DEVstyle-je1bf
    @DEVstyle-je1bf 9 месяцев назад

    Sir big fan

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

    #React OP 👨‍💻

  • @kapil7008
    @kapil7008 7 месяцев назад

    #react_op
    #sigma_batch_op

  • @SarbJeet-js8tl
    @SarbJeet-js8tl 9 месяцев назад +1

    React oppp ❤❤❤

  • @safwanabdullah5827
    @safwanabdullah5827 6 месяцев назад

    very helpfull

  • @siddhantgupta6343
    @siddhantgupta6343 7 месяцев назад

    Why cant we make the "expensive computation" asynchronous instead?

  • @umeraqeel7228
    @umeraqeel7228 8 месяцев назад

    can we also use the useRef hooks ?

  • @Bheesham-m-m248
    @Bheesham-m-m248 9 месяцев назад

    Good job

  • @code.priyam
    @code.priyam 8 месяцев назад +1

    1:47 30 million me ( _ ) kyu lagaya???

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

    Helpfull ❤

  • @whitemask-Community
    @whitemask-Community 4 месяца назад

    #SIGMABATCHOP 🔥🔥🔥🔥🔥🔥🔥🔥

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

    CWH op
    React OP

  • @VishvjeetTag8091
    @VishvjeetTag8091 8 месяцев назад

    In 30 million my Laptop 💻 was Not working 👨‍💻 and warmth like 💥😂😂😂😂😂

  • @notoppergamers1510
    @notoppergamers1510 9 месяцев назад +1

    Sir, I have a doubt why can we not use useEffect instead of useMemo

    • @RudraPatel-mz6iw
      @RudraPatel-mz6iw 9 месяцев назад +1

      useEffect Does not return a value but useMemo Returns the memoized value.

    • @notoppergamers1510
      @notoppergamers1510 9 месяцев назад +1

      @@RudraPatel-mz6iw ok thankyou bro for clearing my doubt👍👍👍👍🔥🔥

  • @BeautyofNature-n9v
    @BeautyofNature-n9v 9 месяцев назад

    From Pakistan ❤❤

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

    React OP

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

    #ReactOP 🎉🎉 Sir...!

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

    React op❤❤

  • @SanikaKasar-b8w
    @SanikaKasar-b8w 9 месяцев назад

    Sigma Bach OP

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

    Django rest api par ek video bana do bhai

  • @aslamghanchi27
    @aslamghanchi27 6 месяцев назад

    Bro vite app me reacts ka logo Hai wo motion me Nahi hota hai aur aap run karte hai tab motion me hota hai.