Created
May 22, 2021 15:37
-
-
Save Sergioamjr/38d0c2239e5f73718ab37b2e3759c4b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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