Closed
Description
Let's say I have some two components, ChildComponent
@themr('ChildComponent')
class ChildComponent extends Component {
render() {
const { theme } = this.props;
return (
<div className={theme.child}></div>
)
}
}
and ParentComponent
@themr('ParentComponent')
class ParentComponent extends Component {
render() {
const { theme } = this.props;
return (
<div className={theme.parent}>
<ChildComponent theme={theme} />
</div>
)
}
}
For the theme
prop of ParentComponent
to be applied to ChildComponent
, it has to be explicitly passed down. It would be a breaking change, but could Themed
define getChildContext
so that the theme
of ParentComponent
is automatically part of the theme
of ChildComponent
?