opendevs
opendevs logo
CoursesInterviewsBlogs

React.memo, useMemo and useCallback

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.
Intermediate Level Project
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)
Watch the full video to earn  3  DevCoin image

Quizzes


1

What are the use-cases for useMemo?

Question 1 of 6
1  DevCoin image   per question
2

What are the use-cases for useCallback?

Question 1 of 6
1  DevCoin image   per question
3

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

Question 1 of 6
1  DevCoin image   per question
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
1  DevCoin image   per question
5

React.memo() is a higher order component?

Question 1 of 6
1  DevCoin image   per question
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
1  DevCoin image   per question
opendevs logo
CoursesFAQsContact UsPrivacy PolicyTerms Of Service
Copyright © 2023 opendevs
Learn ● Develop ● Ace
All illustrations by Storyset