Last active
May 18, 2017 23:50
-
-
Save dy-dx/3e522b6b2cb0a7f9ec20a01bf6ab8fac 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
import React, { Component, PropTypes } from 'react'; | |
export default function fuck(WrappedComponent) { | |
return class FuckedComponent extends Component { | |
constructor(...args) { | |
super(...args); | |
this.state = {}; | |
} | |
setChildProps = (props) => { | |
this.setState(props); | |
} | |
render() { | |
return ( | |
<WrappedComponent | |
{ ...this.props } | |
{ ...this.state } | |
setOwnProps={ this.setChildProps } | |
/> | |
); | |
} | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment