Skip to content

Instantly share code, notes, and snippets.

@Sergioamjr
Created May 22, 2021 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sergioamjr/38d0c2239e5f73718ab37b2e3759c4b1 to your computer and use it in GitHub Desktop.
Save Sergioamjr/38d0c2239e5f73718ab37b2e3759c4b1 to your computer and use it in GitHub Desktop.
import { useMemo } from "react";
export default function Component() {
const value = useMemo(() => {
// Faz algo complexo e demorado.
// Se x e y já tiverem sido usados, irá retornar o valor anterior memorizado.
}, [x, y]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment