Skip to content

Instantly share code, notes, and snippets.

@mijms
Created July 22, 2021 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mijms/159bbb0e4251274b4448c0e3168a8ae8 to your computer and use it in GitHub Desktop.
Save mijms/159bbb0e4251274b4448c0e3168a8ae8 to your computer and use it in GitHub Desktop.
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