pass theme from layout to children
parent
0c53de91a3
commit
491a85c3a0
|
@ -5,7 +5,7 @@ import { LAYOUT } from '../identifiers.js';
|
|||
|
||||
const Layout = ({ className, children, theme }) => (
|
||||
<div data-react-toolbox='layout' className={classnames(theme.layout, className)}>
|
||||
{children}
|
||||
{React.Children.map(children, (child) => React.cloneElement(child, { theme }))}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
|
|
@ -26,7 +26,9 @@ var Layout = function Layout(_ref) {
|
|||
return _react2.default.createElement(
|
||||
'div',
|
||||
{ 'data-react-toolbox': 'layout', className: (0, _classnames2.default)(theme.layout, className) },
|
||||
children
|
||||
_react2.default.Children.map(children, function (child) {
|
||||
return _react2.default.cloneElement(child, { theme: theme });
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue