Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import React from 'react';
import classNames from 'classnames';
import PropTypes from 'prop-types';
function stylifier(higherOrderComponent) {
return Component => styles => {
function StyledComponent(props) {
const { classes, className, ...other } = props;
return <Component className={classNames(classes.root, className)} {...other} />;
}
StyledComponent.propTypes = {
classes: PropTypes.object.isRequired,
className: PropTypes.string,
};
return higherOrderComponent({
root: styles,
})(StyledComponent);
};
}
export default stylifier;
@oliviertassinari

This comment has been minimized.

Copy link
Owner Author

@oliviertassinari oliviertassinari commented Jan 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.