Last active
April 4, 2019 08:45
-
-
Save tommmyy/ccb7ba73572d5421cf9380f3b3ae52a7 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
const Example = ({ onClick }) => { | |
const memoizedHandleClick = useCallback( | |
(event) => onClick(event), | |
[] // ugly magic of hooks | |
); | |
return <Button onClick={memoizedHandleClick}>Click</Button>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment