Skip to content

Instantly share code, notes, and snippets.

@jrwebdev
Last active February 13, 2019 06:12
Show Gist options
  • Save jrwebdev/a4ab39c23145ad396726df232339fa0a to your computer and use it in GitHub Desktop.
Save jrwebdev/a4ab39c23145ad396726df232339fa0a to your computer and use it in GitHub Desktop.
const value = 10;
// inferred as number
const result = useMemo(() => value * 2, [value]);
const multiplier = 2;
// inferred as (value: number) => number
const multiply = useCallback((value: number) => value * multiplier, [multiplier]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment