opendevs
Intermediate Level Project

React.memo, useMemo and useCallback

Loading video...

useMemo Hook in React (in Hindi)

Concepts

    1

    useMemo Hook in React (in Hindi)
    useMemo Hook in React (in Hindi)

    2

    React.memo & useCallback Hook in React (in Hindi)
    React.memo & useCallback Hook in React (in Hindi)
useMemo - The Hook returns a memoized value. React.memo - Causes React to skip rendering a component if its props have not changed. useCallback - The Hook returns a memoized callback function.Finish watching the concept videos to earn    DevCoin image  each
1

What are the use-cases for useMemo?


Question 1 of 6
2

What are the use-cases for useCallback?


Question 1 of 6
3

What are differences between React.memo() and useMemo()?


Question 1 of 6
4

If a function component should always render the same way given the same props, what is a simple performance optimization available for it?


Question 1 of 6
5

React.memo() is a higher order component?


Question 1 of 6
6

Your component contains:

const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);

For a while the memoizedValue was of value 12.

After changing route your component with above code is unmounted & becomes offscreen. User decides to go back to the previous route after a while. What will happen to the memoizedValue?


Question 1 of 6

Copyright © 2022 opendevs

Learn ● Develop ● Ace
All illustrations by Storyset