Created
July 22, 2021 06:42
-
-
Save mijms/159bbb0e4251274b4448c0e3168a8ae8 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
export default function LayoutMain(WrappedComponent) { | |
class FormComponent extends Component { | |
renderControls() { | |
return <p>hi</p> | |
} | |
render() { | |
return ( | |
<WrappedComponent | |
{...this.props} | |
renderControls={this.renderControls} | |
/> | |
); | |
} | |
} | |
const MainComponent = connect( | |
mapStateToProps, | |
mapDispatchToProps | |
)(FormComponent); | |
return MainComponent; | |
} | |
// Using is Like LayoutMain(MyReactComponent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment