Skip to content

Instantly share code, notes, and snippets.

@bbandydd
Created December 17, 2017 12:45
Show Gist options
  • Select an option

  • Save bbandydd/57445fe46b649cd1d3f735a3e150a126 to your computer and use it in GitHub Desktop.

Select an option

Save bbandydd/57445fe46b649cd1d3f735a3e150a126 to your computer and use it in GitHub Desktop.
HOC-disadvantage1
// without {...this.props}
const HOC = (WrappedComponent) => {
return class extends Component {
render() {
return (
<WrappedComponent />
)
}
}
}
// should be
const HOC = (WrappedComponent) => {
return class extends Component {
render() {
return (
<WrappedComponent {...this.props}/>
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment