Mastering React Memo

  Рет қаралды 138,977

Jack Herrington

Jack Herrington

Күн бұрын

Пікірлер: 433
@onebronx
@onebronx 3 жыл бұрын
Jack, I think you should use "reference identity" instead of "referential integrity". The "referential integrity" is a term from a relational database theory and it is a guarantee that all references (foreign keys) point to existing entities and there are no "dangling" references/pointers in your database (or application state). For example, in a normalized Redux store it would mean that if a post object in a "posts" collection has a list of IDs of "comments" (a foreign key form "posts" to "comments"), then all comments referred by the post must be present in the "comments" collection in the store. In a normalized store posts do not keep direct references to comments, only IDs, so it becomes important to care about the referential integrity, as it does not happen naturally. The "reference identity" OTOH is just a special case of an equivalence relation, which guarantees equality of two referenced objects if and only if the references point to the same object ("shallow equality") but ignores structural equivalence ("deep equality"). React relies on the reference identity AKA "shallow equality" of two objects. It does not care about referential integrity, like lack of dangling references in your application state.
@jherr
@jherr 3 жыл бұрын
Fair enough. I'll do that in videos that folow.
@sahej97
@sahej97 3 жыл бұрын
How did you manage to write such a big comment?
@onebronx
@onebronx 3 жыл бұрын
@@sahej97 using a PC instead of a phone :)
@raymondmichael4987
@raymondmichael4987 3 жыл бұрын
@@sahej97, this means he knows these things and followed the video to the end, which implies that, Jack is real good. Keep it up guys, we're luck to have people like you
@raymondmichael4987
@raymondmichael4987 3 жыл бұрын
@@jherr, I watched the whole video. I'm waiting for the next video. Thanks for helping us out
@alexanderkuznetsov634
@alexanderkuznetsov634 3 жыл бұрын
Thank you again! So clear explanation! That is the main difference between junior and senior-level developers - it`s when you can provide a clear explanation to your "team members".
@mcfliermeyer
@mcfliermeyer 2 жыл бұрын
I had about a week of building an app using some components I didnt understand that seemed to require useCallback. I kept getting stale state from it. Now I understand why! Thank you much!!!!
@vladandreit
@vladandreit 3 жыл бұрын
Wow. These kind of videos i need learning react. I'm getting tired about all the crash courses(these are good for getting to know react)or full stack whatever and everybody talks about all the basics for begginers. Your videos are taking my understanding about react to a new level. Thank you. I hope you cover more and more advanced stuff because you explain them so well. Like a teacher.
@jherr
@jherr 3 жыл бұрын
Check the channel, I think you'll find there are enough advanced topics videos to keep your happy for a while. :)
@dastansito
@dastansito 3 жыл бұрын
These Mastering React Hooks series are really, but really helpful. I can't thank you enough for everything I'm learning from this. Keep it going!
@rism8345
@rism8345 2 жыл бұрын
Goddamn! Mm-mm-mm! You took them tutorials on the next level with these transitions and the chapter titles! Probably the best React/Typescript youtube channel out there. Thank you so much for the hard work, can't wait to see you have 500k+ subs on your channel.
@arsalanhussain6499
@arsalanhussain6499 2 жыл бұрын
The way explianed memoization comparing to traditional memorization was just amazing. in fact you just thought me how memizationreally works under the hood in react. the part where you mentioned when to or not to use moemo in react was also great example to understand the need for memo. thank you very much🙂
@vigyanhoon
@vigyanhoon 2 жыл бұрын
I love the way you jump to code instead of wasting time on talking like others. Keep it up!
@mohsinwaseem9770
@mohsinwaseem9770 2 жыл бұрын
This is the best video I have seen on the topic. From giving the concepts to telling its pros cons with correct usage. All things are included in depth summarized in this 27 min tutorial. Hope you channel grows
@mirajaryal3322
@mirajaryal3322 3 жыл бұрын
Been looking at lots of videos and reading a lots of articles but couldn't get my head around when and on what these hooks must be used. And with this video everything is crystal clear. Was such a simple concept. Thanks Jack for this great video. Been following your a while for quality content.
@sideshowlol
@sideshowlol 3 жыл бұрын
From the moment you casually typed “zoom” as a css property (which I didn’t realise was even a thing), I knew this was going to be a good’un. Thank you, Jack. Wonderfully clear explanations. 🙏😎
@shankarmylsamy
@shankarmylsamy 3 ай бұрын
Me too 😂
@geralt36
@geralt36 2 жыл бұрын
Your videos are always so clear, detailed and to the point. Every time I click on one of your videos and think I know about the subject, I always end up learning something new. Thank you for sharing your knowledge with us!
@thehaptiK
@thehaptiK 3 жыл бұрын
that transition at 0:45 is NICE.
@vitorwindberg4212
@vitorwindberg4212 3 жыл бұрын
The explanation about VDOM and DOM was amazing, I didn't know any of how that worked in React and I bet a lot of people don't as well. Thank you for your videos!
@down__lo7359
@down__lo7359 2 жыл бұрын
"React Memo" == "Render if the props have changed"
@CHN-yh3uv
@CHN-yh3uv 9 ай бұрын
Why isn’t this the default behavior though?
@nicholasfane1081
@nicholasfane1081 3 жыл бұрын
These videos are gold Jack, it's hard to find such high quality and down to earth tutorials like these. Keep it up!
@alii4334
@alii4334 2 жыл бұрын
The best tutorial on YT I've ever watched about the topic!
@retinafunk
@retinafunk 3 жыл бұрын
I watched a lot of other docs and tutorials on those hooks and now finally I feel understand this properly, even if I used it many times already successfully now I get the fine details and differences and also when not to use them
@juandsoto1651
@juandsoto1651 3 жыл бұрын
This is something really important that almost anybody takes the time to explain. Thank you so much and keep on this kind of amazing vids!
@Gringo0517
@Gringo0517 3 жыл бұрын
Recently discovered your channel and have found it extremely valuable! Liked and subscribed. You have a very clear way of explaining things that I have been struggling with for quite a while :D Thanks and hope your motivation stays high for creating more content!
@maxklammer3370
@maxklammer3370 3 жыл бұрын
Thank you Jack! :) Every time I come to you channel I learn something new :)
@sergemorales8709
@sergemorales8709 Жыл бұрын
Hey Jack, just wanted to drop a quick message to say thanks for the video! I've been following your content for quite a while now, and I gotta say, you're hands down the best I've come across. I've learned so much from you, not just about coding but also your logical and concise explanations. Thanks again, really appreciate it!
@vigyanhoon
@vigyanhoon 2 жыл бұрын
Thanks for this, my useMemo and virtual dom concept wasnt much clear before I watched this. Thanks.
@topsoilgargoyle
@topsoilgargoyle 3 жыл бұрын
Jack, i have avoided using memoization in React for a long time. I've read blogs, watched tuts, without success. You're lesson here has just made everything click! Your preparation and relevant information are extremely valuable. Thank you very much.
@jherr
@jherr 3 жыл бұрын
You should still avoid it tho. No reason to use it unless you have a genuine performance issue.
@leszekmodrzejewski7372
@leszekmodrzejewski7372 2 жыл бұрын
I have seen dozens or even hundreds of youtube tutorials and this one is one of the best. Great content. I like most that the information is coherent, forming a whole. It is explained in detail. The pace and tone of Jack's voice are engaging. Fantastic job 👏👏👏
@mattlennon3
@mattlennon3 3 жыл бұрын
Excellent breakdown, I think the part on renaming the function in your head is critical to understand this function for what it actually does. Really well edited video too, I'm looking forward to more from your channel!
@minsaf8216
@minsaf8216 3 жыл бұрын
Found exactly what I've been looking for. Great explanation. Clear and easy to understand. Please do a series on advance react concepts
@jherr
@jherr 3 жыл бұрын
So what would you consider advance React concepts?
@minsaf8216
@minsaf8216 3 жыл бұрын
@@jherr concept like Error boundaries, custom hooks
@jherr
@jherr 3 жыл бұрын
@@minsaf8216 Cool. I actually have covered those a bunch, just not in their own videos. I'll have to think of a good way to do that specifically for its own video.
@me_rinta
@me_rinta 2 жыл бұрын
Very helpful video. Straight to the point, examples and comparisons included. Definitely cleared up a lot of my questions about React memoization. Thank you 🙏🏻
@swapnilsingh7553
@swapnilsingh7553 2 жыл бұрын
Hi Jack, Extremely grateful for this insightful Mastering React series, a small correction at 18:30, I assume you meant to click on the Re-Render app button instead of the Change color button to demonstrate the memo failure with object type parameters.
@boopfer387
@boopfer387 2 жыл бұрын
Jack one of the best breakdowns I've seen on React Memo thank you very much!
@adnanahmed4176
@adnanahmed4176 2 жыл бұрын
Your explanation skills and demo demonstrations are so amazing! Great videos!
@Will4_U
@Will4_U 3 жыл бұрын
Fantastic explanation! Personally, I was struggling and confused about using memorization in React, but this video definitely helped me to understand this topic. Thanks Jack ❤
@bythealphabet
@bythealphabet 3 жыл бұрын
Great content Jack, thank you for taking the time to explaining React Memo so clearly.
@jarrettyew
@jarrettyew 2 жыл бұрын
Great explanation! Was referring the official react doc but it wasn't as clear as this video!
@DavidCCR
@DavidCCR 3 жыл бұрын
Really great explanation. Your videos are getting better and better! Thanks a lot!
@utkarshsrivastava4106
@utkarshsrivastava4106 2 жыл бұрын
You can tell right away by his thinking out loud, that he is a senior developer xD. Thank you for your amazing content :)
@xieweiling7543
@xieweiling7543 3 жыл бұрын
The best and most thorough explanation I've ever seen! Fantastic!👍
@andenetalexander5244
@andenetalexander5244 3 жыл бұрын
By farrrrrrrrrrrrrrrrrrrrrrrrrr the best tutorial on those topic out there. Greate explanation! 👏
@krishgarg2806
@krishgarg2806 3 жыл бұрын
Thanks! Really nice and informative video, and again thanks for taking my suggestion :)
@jherr
@jherr 3 жыл бұрын
It was a good one!
@atuldubey8146
@atuldubey8146 2 жыл бұрын
Best explanation for memoization on KZbin.
@sukeshkumard6064
@sukeshkumard6064 3 жыл бұрын
The best and detailed explanation on memo. Thank you so much.
@alimohammadi1517
@alimohammadi1517 3 жыл бұрын
Amazing content as always , really can tell that this vids are professional because of how fluent you are with the syntax , the examples and the visuals of the video overall everything is very pleasing thank you
@lucaszapico926
@lucaszapico926 2 жыл бұрын
Thanks for the video! Comprehensive, straight forward and thorough. 🙏
@ajstimson
@ajstimson 2 жыл бұрын
Jack's discussion of "Don't Sweat Re-Renders Too Much", was eye opening. Thanks for explaining it in reference to old jQuery methods!
@MistaT44
@MistaT44 2 жыл бұрын
One of the best channels out there! Thank you
@lsowein
@lsowein 3 жыл бұрын
Thank you! I really enjoy your content. Always concise and insightful! Great editing btw :)
@kyriakosbekas
@kyriakosbekas Жыл бұрын
Great explanation Jack! Thank you for your content!!
@axe-z8316
@axe-z8316 3 жыл бұрын
wow the content is getting so much better ! great video !
@mdnamussakib8077
@mdnamussakib8077 2 жыл бұрын
Great Video. Thanks soo much. The whole react memo became very clear for me.
@permanar_
@permanar_ 2 жыл бұрын
This is really on a whole another class. Rich information yet so compact at a time. Thank you!!
@manassharma7698
@manassharma7698 6 ай бұрын
This video is a total life saver . Thanks for such a good video.
@batumanav
@batumanav 2 жыл бұрын
This was purely informative, thank you so much.
@EnesKab
@EnesKab 3 жыл бұрын
Thank you Jack ! I was looking forward to this. I am going to do few experiments for my own cases, but after that video, I feel better and less stressful about re-rendering I guess 😊
@sourabhkulkarni1731
@sourabhkulkarni1731 2 жыл бұрын
Loved your explanation. I subscribed immediately!!
@ukaszzbrozek6470
@ukaszzbrozek6470 2 жыл бұрын
Great stuff ! This topic was always confusing to me. Thanks !
@alisonhj
@alisonhj 2 жыл бұрын
Thank you for your amazing explanation! You made it so much clear to understand!
@artyomkorbut5623
@artyomkorbut5623 2 жыл бұрын
Great video, Jack! Thank you so much for your work! Keep it going.
@andresrestrepo5210
@andresrestrepo5210 2 жыл бұрын
¡Gracias!
@jherr
@jherr 2 жыл бұрын
Thank you so much!
@raymondmichael4987
@raymondmichael4987 3 жыл бұрын
I watched several videos on this channel, and I see all new videos ; To my surprise, I wasn't a subscriber to the channel yet!! 🙆🏾‍♂️, Subed now 🤓
@mirtanvirahmed3868
@mirtanvirahmed3868 3 жыл бұрын
i liked the video before even watching.. I know it will be a great one 💯
@rafaelnunes6918
@rafaelnunes6918 2 жыл бұрын
Thanks, this was the best explanation I've ever heard.
@haroldpepete
@haroldpepete 3 жыл бұрын
you've got a new subscriber sr, you have the craft or art of teach good and clear
@akramadil7502
@akramadil7502 2 жыл бұрын
Thank you, your explanation way is so amazing and I learned a lot and how you use examples is great.
@Billy_98
@Billy_98 3 жыл бұрын
Amazing job!!! I hope u will get that Silver Play Button soon. Big like!
@b29gupta
@b29gupta 2 жыл бұрын
Hey! Jack, Thanks for explaining the memoization. This explanation really cleared the concept and usage well. Can you also create a video on redux-thunk vs redux-saga. That would be real great. Thanks again
@大盗江南
@大盗江南 3 жыл бұрын
Great great video!! U explained the useMemo so well !!!
@diyaagubarah3328
@diyaagubarah3328 2 жыл бұрын
best explanations ever I love your way for teaching.
@d0paminer
@d0paminer 3 жыл бұрын
The only foreign teacher i've been subscribed. Thx from Russia, you are cool man)
@jherr
@jherr 3 жыл бұрын
Thanks! 😃
@tazimmahta7625
@tazimmahta7625 2 жыл бұрын
8:51 ""it compares the previous props with new props. And when those props have changed it re-renders. Thats all memorization is. "". Missed that in an interview :')
@444ous
@444ous 3 жыл бұрын
Jack you are an amazing teacher! Thank you for this video!
@andreslikesramen
@andreslikesramen 2 жыл бұрын
best video on this subject thanks for helping me understand this better
@haribhushan
@haribhushan 2 жыл бұрын
JACK your way of teaching makes you the best teacher i have ever seen .I am super impressed by the MFE video you explained .may i know what is that extension which is showing function output immediately
@JulioDx3480
@JulioDx3480 3 жыл бұрын
Extremely good explanations, thank you!
@hamdinahdi899
@hamdinahdi899 2 жыл бұрын
awsome and comprehensive explanation thanks a lot
@brilliantatosam
@brilliantatosam 2 жыл бұрын
Great content. You're a wonderful teacher. Keep up the good work, Sir.
@julianfmartinez
@julianfmartinez 2 жыл бұрын
Clear explanation, now I get it, thank you.
@bjrnolavgjrven2955
@bjrnolavgjrven2955 2 жыл бұрын
@26:36 my face when he slid across the room revealing that the background is a green screen :o :o :o Thats the most impressive green screen I have seen on youtube, it looks so realistic! Also, the transition between your hair and the background is pretty much not noticable. Much impress.
@djitaispector2329
@djitaispector2329 2 жыл бұрын
Thank you for this. I've been watching several videos from you, and they are all great. You go deep and into details, and throughout the way you teach a lot of small things that can help build the bigger picture. I'm interested to know about your career history, can you make a video about that? like when you started to program, what languages, frameworks, talk about the evolution of computer science from your aspect and so on... Cheers! (btw finally subscribed!)
@oliver_ai
@oliver_ai 2 жыл бұрын
Thank you for the masterclass on these topics
@diyaagubarah3328
@diyaagubarah3328 2 жыл бұрын
/** * So we use combination between memo & (useMemo - useCallack) * memo is good for comparing value like string number * but when it comes to function,Array,Object props we must pass the reference for those to memo Component * and we do that by passing useMemo(Array,Object) - useCallback(callback) function to that memo component */
@fooked1
@fooked1 Жыл бұрын
Probably the best explanation on this topic.
@ryanknight2170
@ryanknight2170 3 жыл бұрын
Wish this video was created a long time ago! Would have sped up my understanding 10x
@anncascarano8589
@anncascarano8589 2 жыл бұрын
Hey Jack! I really appreciate the deep dives. Thank you!
@cayque_freitas
@cayque_freitas 3 жыл бұрын
Hey, thank you for this awesome video! Really good explanation :)
@Justjames283
@Justjames283 3 жыл бұрын
Jack is hands down the best JavaScript teacher on KZbin!
@marcelsdev
@marcelsdev 2 жыл бұрын
Jack, awesome videos like always, and great detailed explanation. One thing, just before your "5 Things To Remember" section, your video background tilts and slides away - At that moment I looked away and from the corner of my eye it looked like my screen was falling off my desk! Hahahaha, I got a fright there for a split second! 🤣
@jherr
@jherr 2 жыл бұрын
Hahah, I'll put a warning on the net one. :P
@esmaeilmirzaee
@esmaeilmirzaee 3 жыл бұрын
Thank you so much, Mr. Herrington. It is really informative and well explained.
@jherr
@jherr 3 жыл бұрын
It's Herrington. :) And, thank you.
@esmaeilmirzaee
@esmaeilmirzaee 3 жыл бұрын
@@jherr Sorry, my bad. I corrected it.
@Vincent_A.Freeman
@Vincent_A.Freeman 3 жыл бұрын
This is GOLD ! Thank you.
@ThomazMartinez
@ThomazMartinez 2 жыл бұрын
Couple of questions, 1. when you test JS code what exstention do you use to run the code straight away and display in editor? 2. what do you use to autocomplete code for you?
@jherr
@jherr 2 жыл бұрын
I often use WallabyJS, and for auto completion I use GitHub Copilot.
@dazjacktar6202
@dazjacktar6202 2 жыл бұрын
Thanks mate, perfect explanation!
@jialx
@jialx Жыл бұрын
The segment 'Don't sweat Re-renders to much' is personal favourite.
@someshmusunuri4233
@someshmusunuri4233 2 жыл бұрын
best explanation with example. Thankyou
@Arunnn241
@Arunnn241 3 жыл бұрын
Hi Jack, awesome video! I really learned a lot and it taught me a lot on why some of my old front end optimizations didn't work as intended. One small thing, at 18:30 you show off how React.memo breaks when we use reference types as props because React makes a new object every render. But in your example, you click on the change color button and not the rerender app button. In that case (the case of clicking the *change color* button) we would expect that both the memoized and non-memoized component should rerender because the color is different. Correct?
@jherr
@jherr 3 жыл бұрын
Yes.
@Arunnn241
@Arunnn241 3 жыл бұрын
@@jherr awesome thank you for taking the time to validate my understanding
@valentina711
@valentina711 2 жыл бұрын
I had the same observation too. I think Jack meant to click on the Re-render button to prove his point, as he is doing later in 19:40 and in 20:25, after fixing the reference. Awesome video; thanks so much
@htrcs
@htrcs 2 жыл бұрын
This should be pinned because I was instantly thrown off by that.
@AM-nm6ts
@AM-nm6ts 2 жыл бұрын
thank you sir for your intelligence and your pedagogy. very well explained. god bless u
@jherr
@jherr 2 жыл бұрын
thank you for getting me to look up pedagogy. :)
@kashifniaz4627
@kashifniaz4627 Жыл бұрын
Thanks. it's really too much to digest. from-now I am your content follower.
@shubhamlatiyan7972
@shubhamlatiyan7972 3 жыл бұрын
Thanks Jack, for the awesome video
@nafas-ki7ce
@nafas-ki7ce 2 жыл бұрын
You a wonderful teacher. thanks for your videos
@kishoreandra
@kishoreandra 2 жыл бұрын
Amazing video jack ... That comparison with loadash is great one to remember react.memo forever 🤘, just surprised that the button clicked times is not updating 🤔 is always 0 (oh my bad !! It's on color click 🤣)
@ishan101
@ishan101 3 жыл бұрын
Thank you, this is really impressive and clear.
@trenthm
@trenthm 2 жыл бұрын
Another great video! Thanks!
Mastering React Batch Updating
10:23
Jack Herrington
Рет қаралды 45 М.
Making React Context FAST!
33:34
Jack Herrington
Рет қаралды 91 М.
Power Apps Beginner's Guide: Getting Started with Power Apps Studio
17:30
Mastering React's useEffect
25:20
Jack Herrington
Рет қаралды 177 М.
You Probably Shouldn't Use React.memo()
10:17
Theo - t3․gg
Рет қаралды 59 М.
You're Doing React Hooks Wrong, Probably
20:11
Jack Herrington
Рет қаралды 64 М.
What is React.memo - It's not useMemo
15:29
Dave Gray
Рет қаралды 9 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 29 МЛН
UseState: Asynchronous or what?
17:00
Jack Herrington
Рет қаралды 67 М.
Goodbye, useEffect - David Khourshid
29:59
BeJS
Рет қаралды 506 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
The Most Important Design Pattern in React
35:04
Cosden Solutions
Рет қаралды 128 М.