Created
August 13, 2018 16:43
-
-
Save shawnbot/bda54c202f20ea431f82b50b21e5b776 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 extend(Component, extensions = {}) { | |
const {fixedProps, ...otherExtensions} = extensions | |
const Extended = fixedProps | |
? props => <Component {...props} {...fixedProps} /> | |
: props => <Component {...props} /> | |
return Object.assign(Extended, Component, otherExtensions) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment