Open Khandagale-Saurabh opened 2 years ago
UseCallback
UseCallback is a React hook that lets you memoize a function. It can be used to optimize performance by caching the function so that it only needs to be created once.
Example:
const memoizedCallback = useCallback(() => { doSomething(a, b); }, [a, b]);
UseMemo
UseMemo is a React hook that lets you memoize a value. It can be used to optimize performance by caching the value so that it only needs to be calculated once.
Example:
const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
1] ComponentDidMount => UseEffect(()=>{ },[]} 2] ComponentDidUpdate => useEffect()=>[User] 3] WillUnmount ] => return inside useeffect
Datat from child to parent
Redux :