import { useMemo } from "react";
      
      const memoizedValue = useMemo(() => { 
        return computeExpensiveValue(dependency1, dependency2) 
      }, [dependency1, dependency2]); 
      Javascript language logo
      your recipe card header background

      React useMemo

      0

      2

      avatar
      Jose Romero
      react
      hook
      memo
      ...
      React JavaScript Recipes

      Returns a memoized value.

      Pass a β€œcreate” function and an array of dependencies. useMemo will only recompute the memoized value when one of the dependencies has changed. This optimization helps to avoid expensive calculations on every render

      Library: react

      Shortcut: react.hook.memo.use

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.