good bro... One doubts, useMomo is return memoized value, use call back is return memoized function ... this two line I am not able to understand clearly please explain me man
So if you have created any function and assign it to an variable on each state change the component will create new function each time. So to avoid that we are using useCallback. Same vice versa for useMemo also to Perform any operation and return a value after execution of function only if any state changed then we will use useMemo. By using both we can avoid unwanted rerendeing of child components.
React.memo check the child componet value if changes then re render else no need same time usecallback only re render if the value of component is change else re render use case no need to re render whole component that's my understand is it correct
React.memo is a higher-order component that optimizes performance by memoizing the result of a component's render. It helps in preventing unnecessary re-renders when the component's props haven't changed
Thanks it's full 🌕🌝.
Please continue to reactjs with redux. And projects...
Many projects
Thank you. Stay tuned
Thanks its very useful
Welcome 😊
good bro...
One doubts, useMomo is return memoized value,
use call back is return memoized function ... this two line I am not able to understand clearly please explain me man
So if you have created any function and assign it to an variable on each state change the component will create new function each time. So to avoid that we are using useCallback. Same vice versa for useMemo also to Perform any operation and return a value after execution of function only if any state changed then we will use useMemo. By using both we can avoid unwanted rerendeing of child components.
React.memo check the child componet value if changes then re render else no need same time usecallback only re render if the value of component is change else re render use case no need to re render whole component that's my understand is it correct
React.memo is a higher-order component that optimizes performance by memoizing the result of a component's render. It helps in preventing unnecessary re-renders when the component's props haven't changed