Skip to content

Instantly share code, notes, and snippets.

@yamadapc
Created March 15, 2016 20:16
Show Gist options
  • Save yamadapc/967f765a38b96d5b5efa to your computer and use it in GitHub Desktop.
Save yamadapc/967f765a38b96d5b5efa to your computer and use it in GitHub Desktop.
.bordered-component-root div {
box-shadow: inset 0 0 0 1px yellow;
}
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