parvus-ui
Version:
A micro UI kit with all the main UI components in less than 5KB
16 lines (13 loc) • 332 B
JavaScript
/* @flow */
import React from 'react';
import themeContext from './themeContext';
const withTheme = (Component: Function) => {
return (props: Object) => {
return (
<themeContext.Consumer>
{theme => <Component {...props} theme={theme} />}
</themeContext.Consumer>
);
};
};
export default withTheme;