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 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.
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 ❤
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 😂😂😂❤❤❤❤
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)
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.
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
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.
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
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
🎯 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
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
#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
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.
How is it any different from useEffect then?
@@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.
@@SwatejTech life cycle kaha se padhe aapne? harry ne to shayad nhi padhaye
@@SwatejTech bhai useEffect ko sirf ek baar chalaye to result to same hi aayega na??
@@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
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 ❤
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 😂😂😂❤❤❤❤
In 30 million my Laptop 💻 was Not working 👨💻 and warmth like 💥😂😂😂😂😂
@@VishvjeetTag8091 kisne bola tha bund panga lene ko
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)
i've also been watching him since 2018
Absolutely stunning and phenomenal
Sir aapne kaha useMemo Tricky hai par aapne samjhaya to yesa laga nahi ki ye tricky hai.
Thanks for best explanation.
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.
really is vide me usememo bahut easy way me samjhaya gya h mujhe sirf ek baar video dkhne se hi samjh aa gya.
This course is much better than any other paid course bahoot se course liya maine par aisa content nhi mila
Bro chai aur code pe jao phr ptta chle ga
@@FarazAhmadDev waha se aya hu bhai
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
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.
But magical number aur count ek he component Mai hai to use effect se bhi component pura render hoga he na?
Harry Bhai ki videos ki quality is superb
Harry bhai be like : "Jo dimaag mein , wo mooh par " .😃😃.Lots of love harry bhai , thanks for helping .
great explanation, struggling to understand for long time by reading docs, but this explanation was legend, Thanks
You are the best coding teacher
@@huehue..
DUAALLAH US MAQSAD PY JIOON JISPY TUNY BHEJA HY
The best coding teacher ever 😍😍 #ReactOp
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
kuxh bhi dekh lo knhi se bhi dekh lo lekin ek baar code with harry ke paas aana hi padega
#ReactOp ❤
Very helpful course bhaiya
You not know how many siblings are watching your course for achieving their goals
thanks Harry Bhai🚀🚀🚀🚀🚀🚀🚀🚀 love from 📍Odisha
Best Course 5 out of 5🙅
7:25 useMemo hero entry
Sigma Batch Op😂😂🔥🔥❤❤🔥🔥🤞🤞
Basically it's dynamic programming in react.
Amamzing Lecture
great explanation sir
*Mainn aapko explain karunga aap tension mat lena* Thank you big brother. Love and respect. Always.
In ayodhya
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
sir great love from me ,
i have learned from you so much and now im teaching as well
This time Harry bhai is like:- Jitna Aata hai sab sikha dunga pro nahi piro-fes-nal bana Dunga....
IsMagical: I === 9999900
Ismagical is set TRUE on these stage already
Then we check memo where we getting true
Hope it should help
Dhanywaad Guru.....❤
Big O(n) time and space Complexity
🎯 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
harry bhai always rocks
Great it is useful for optimising website 👍😯
Sigma batch OP
React js OP
Awesome explanation
Mujhe ab tak react mai sab samajh mai aa gaya but router mai dikkat ho raha, mujhe detail mai router sikhna hai😅
Mujhe bhi sikhna he yarr
#React Op #SigmaBatchop Best teacher of coding on RUclips
#CodeWithHarry rocks & #ReactBatchOP rocks 🤟👍
In the particular case you explained, i guess useEffect hook will also the same functionality naa?
Absolutely
10:55 आखिरकार इस वीडियो भी छोड़नी पड़ी ।
sigma batch op>>
useMemo op
harry bhai double op
UseMemo is some what like UseEffect
React Op Love you Harry bhai❤❤
it can be used in ecommerce app
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
React js op
Thnx brother
Sir come to ayodhya🎉🎉 please sir
eid mubarak
#SigmaBatchOp
#ReactOp
#Harry sir❤❤
Sigmabatch Op ❤
Sir is course mai approximately kitne videos honge please reply 🙏🙏🙏🙏
#sigmabatchop
#harrybhai
#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
#Doubt
Hii, Thank you for your amazing tutorials ,
Is it necessary to install express every time whenever we create new file?
No
Harry Bhai Op in the chat
well explained
Sir Flutter and Dart language pe videos share kar do...✅👍
Sir plz algo trading par ek playlist bana do
Sir algorithm trading par bi ek play list bana do sir
React OP !
Use react in thumbnail for more views
WHAT?
@@shubhtalk7073he is asking him to write "React" in the thumbnail to get more attention
@@yusrax3 ok
kya program tha laptop hang badi mushkil se chala h laptop but maja aa gya
Memo se dsa ki yaad agai🥲
React OP!!
Bhaiya Mai Bhaiya HArry bhaiya
Sigma batch op
Harry Bhai op❤❤❤❤
Kaash mai ek software developer hota 😢😢
sir please iske bad next js padhana
React Op ❤
Did you face any problem while shooting intro
आपका Computer तो बहुत fast है।
Dude please make a video on moviepy
thanks
Yesterday I was facing rerender 4 time at once maybe it's help me
Sir big fan
#React OP 👨💻
#react_op
#sigma_batch_op
React oppp ❤❤❤
very helpfull
Why cant we make the "expensive computation" asynchronous instead?
can we also use the useRef hooks ?
Good job
1:47 30 million me ( _ ) kyu lagaya???
Helpfull ❤
#SIGMABATCHOP 🔥🔥🔥🔥🔥🔥🔥🔥
CWH op
React OP
In 30 million my Laptop 💻 was Not working 👨💻 and warmth like 💥😂😂😂😂😂
Sir, I have a doubt why can we not use useEffect instead of useMemo
useEffect Does not return a value but useMemo Returns the memoized value.
@@RudraPatel-mz6iw ok thankyou bro for clearing my doubt👍👍👍👍🔥🔥
From Pakistan ❤❤
React OP
#ReactOP 🎉🎉 Sir...!
React op❤❤
Sigma Bach OP
Django rest api par ek video bana do bhai
Bro vite app me reacts ka logo Hai wo motion me Nahi hota hai aur aap run karte hai tab motion me hota hai.