Skip to content

Instantly share code, notes, and snippets.

@HuyAms
Created November 11, 2019 08:56
Show Gist options
  • Save HuyAms/744686913e5b63abeaf65715d27e60ba to your computer and use it in GitHub Desktop.
Save HuyAms/744686913e5b63abeaf65715d27e60ba to your computer and use it in GitHub Desktop.
const App = () => {
const fooFunction = () => {
return 'Foo is just Food without D'
}
const useMemoResult = React.useMemo(fooFunction, [])
const useCallbackResult = React.useCallback(fooFunction, [])
console.log('useMemoResult: ', useMemoResult)
console.log('useCallbackResult: ', useCallbackResult)
return <p>Foo is just food without D</p>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment