Skip to content

Instantly share code, notes, and snippets.

@dy-dx
Last active May 18, 2017 23:50
Show Gist options
  • Save dy-dx/3e522b6b2cb0a7f9ec20a01bf6ab8fac to your computer and use it in GitHub Desktop.
Save dy-dx/3e522b6b2cb0a7f9ec20a01bf6ab8fac to your computer and use it in GitHub Desktop.
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