-
-
Save alex3165/5c43891c41b98ea0ac83b34e09c4fc4a 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
class Button extends React.Component { | |
static defaultProps = { | |
color: 'blue' | |
} | |
render() { | |
return ( | |
<div style={{ | |
color: this.props.color | |
}}> | |
</div> | |
); | |
} | |
} | |
export default window['button-wrapper'] | |
? window['button-wrapper'](Button); | |
: Button | |
// MVT define the wrapper | |
window['button-wrapper'] = (Component) => { | |
return class WrappedButton extends Component { | |
static defaultProps = { | |
...Component.defaultProps, | |
color: 'green' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment