Комментарии:
Amazing as always
ОтветитьWow! The expiations open my eys to understand how the sum functions are created repeatedly. Awesome!
ОтветитьThanks for that, so basically only time to use useCallback is when you put the function name within the useEffect dependency, other than that you don't need it?
In some code at work we have a use effect with [] as the dependency, and in that useEffect it sets up a onClick listener and assigns a function to the onClick, that function is within a useCallback -- this that right? (Also have the clean up for removing the onClick listen too)
I really wish I had found an instructor like you earlier!
ОтветитьYoooo you better start your udemy course I ll be the first one to pay😂. Your explanation was perfect and you know how to explain the concepts perfectly with good examples.
ОтветитьGreat Tutorial.Thanks a lot 😇
ОтветитьThis single tutorial is better than whole 250$ course
ОтветитьThis is the clearest explanation video I have ever watched. Thanks
ОтветитьThat's what I need, Thank you! the screen view is big for me easy to see Chrome dev tool. :D
ОтветитьI'm so glad I found your channel. I really appreciate the great tutorials. Thank you!
ОтветитьFot mr this tutorial is best explaining useCallback, Thanks!
ОтветитьGreat tut. Thanks
Ответитьyou are incredible. I am grateful that I found your channel
ОтветитьGreat. Thanks.
Ответитьyou earned yourself a subscriber, this is the perfect explanation
ОтветитьWonderful topic treated by a wonderful teacher.
All these years I have remained a beginner until I came across your channel and I am very excited about stepping up my skill set to advanced react developer 😎
can somebody please explain how he's able to see the error telling him to add the function to useCallback... is it an extension or something?
Ответитьnicely explain thank you 😀
Ответитьfor that van helen signature guitar, I should have known from the beginning that your content is gold.
Ответить👍👍👍👍👍👍👍👍❤❤❤❤ thanks!
Ответитьunrelated, but which colour scheme are you using here?
ОтветитьTHANKS A LOT!!! Perfect explanation! 😍
ОтветитьCrystal clear explanation. Thank you so much sir ❤️
ОтветитьMy favorite web dev instructor <3
ОтветитьWhy did we had infinite rendering. Can you please explain that part and how did you avoid that?
ОтветитьEarned a subscriber today, great video.
Question: If you defined your function in an external file and imported it, then you wouldn't need to use useCallback in this scenario? Or am I missing something.
I might be a noob in React but can anyone explain why we would ever use a function as dependency in userEffect? Would we wait for anyone to change that function definition then we will run our logic inside useEffect?
Thanks.
About time. I actually came for a refresher after watching your other videos. Your Redux Toolik playlist is what introduced me to your channel. Thanks to that I have implemented RTK Query instead of using Axios interceptors for a project I am currently working on. keep it up
ОтветитьThis is what a real tutorial should be like. Not just blindly copy/pasting code but explaining the inner workings of stuff. Thanks man!
ОтветитьFanstastic explanation. Thanks
Ответитьwhy is if i didint call sum() in console in useEffect but have sum as dependency.
useEffect(() => {
console.log("sum is");
}, [sum]);
changing in state of setUserInput still call useEffect and console too. cause i didint call the sum() function there. i didnt understand that. my guess is that when change in state give new reference to sum(), thats why it behave in this way .
please help me
why wouldn't you put either, [num1, num2] (only re-run when the numbers being summed change) or [sum()] (only re-run when the actual sum returned changed) as your dependency array? that way you aren't relying on a function ref for dependency.
also, useEffect isn't really a good place for this kind of code. it's better to place that into event handlers. useEffect should really only be for synchronization tasks.
useCallback is really only important when you are passing a function as a prop to another component. if you are doing this, then useCallback prevents re-renders of the tree caused by referential changes of the prop.
So good tutorial
ОтветитьThanks Dave, this gave me detailed knowledge about useCallback hook.
ОтветитьExcuse me sir, so if we have a function that calls api that returns an array/object, should we put it in useCallback?
ОтветитьDave, can you explain to me, why you add the function as a dependence in the useEffect? I don't dever see this case, usually it is props or state items.
Ответитьwhat vs theme are you using? looks amazing
ОтветитьI love your way of explaining things Dave. I am following a React course on Udemy, and i always end up at your channel to get a better understanding of al the React topics. Your explanation is just simple, and your not "over" explaining things. Thanks, and keep up making this valuable content!
ОтветитьThanks for this Gold lesson.❤
ОтветитьGreat tnx
ОтветитьGreat teaching skill. Thank you Sir. 👍
Ответитьawesome video Dave,, thank you so much
ОтветитьThanks Dave 😀
ОтветитьYou are a very good teacher Dave. Appreciate your work. Kudos
ОтветитьThanks for tutorial Dave! Correct me if I am wrong, if we do not pass function in dependency array, we don't need to memoize it (there is no reason) or is it still an overhead for performance to constantly recreate those function everytime? Don't feel like wrapping every function inside component is correct approach.
Ответить