Created
January 3, 2020 19:44
-
-
Save tudorilisoi/a1c7042ed8e3f648f2fa7f4c6f8dd6c2 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 const withLayout = (C, cProps = {}) => { | |
const name = `withLayout-${C.displayName || C.name}` | |
function WithLayout(props) { | |
return ( | |
<Layout {...props}> | |
<C {...cProps} /> | |
</Layout> | |
) | |
} | |
WithLayout.displayName = name | |
return WithLayout | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment