Skip to content

Instantly share code, notes, and snippets.

@ohansemmanuel
Created April 26, 2019 04:02
Show Gist options
  • Save ohansemmanuel/a1a0e3b655663d44741f1d71ccdcf5fc to your computer and use it in GitHub Desktop.
Save ohansemmanuel/a1a0e3b655663d44741f1d71ccdcf5fc to your computer and use it in GitHub Desktop.
- import { PureComponent } from 'react'
+ import { memo } from 'react'

- class Benny extends PureComponent {
-   render () {
  
+ const Benny = memo(() => {
   return <Consumer>
     {position => <svg />}
   </Consumer>
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment