Created
March 15, 2016 20:16
-
-
Save yamadapc/967f765a38b96d5b5efa 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
.bordered-component-root div { | |
box-shadow: inset 0 0 0 1px yellow; | |
} |
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
import "./index.css"; | |
import Component from 'react-pure-render/component'; | |
import React from 'react'; | |
/** | |
* Wraps a component with a CSS class that makes all divs within it to have an | |
* yellow inset border. | |
*/ | |
export default borderedComponent(Comp) { | |
class BorderedComponentWrapper extends Component { | |
render() { | |
return ( | |
<div className="bordered-component-root"> | |
<Comp {...this.props} /> | |
</div> | |
); | |
} | |
} | |
return BorderedComponentWrapper; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment