If I have a simple root component in React
AppLayout = React.createClass({
childContextTypes: {
muiTheme: React.PropTypes.object
},
getChildContext: function() {
return {
muiTheme: ThemeManager.getCurrentTheme()
};
},
render() {
return (
<div>
{ this.props.content }
</div>
)
}
});
And a FlowRouter / ReactLayout setup like this
FlowRouter.route('/register', {
name: 'register',
action: function(params) {
ReactLayout.render(AppLayout, { content: <AuthRegisterPage /> });
}
});
Then within the render() method of AuthRegisterPage, this.context is undefined. However, if I don't use { this.props.content } and simply have <AuthRegisterPage /> within the AppLayout component then this.context returns {muiTheme: someobject} as I'd expect.
I'm not a react expert by any means. Am I missing anything?
If I have a simple root component in React
And a FlowRouter / ReactLayout setup like this
Then within the
render()method ofAuthRegisterPage,this.contextis undefined. However, if I don't use{ this.props.content }and simply have<AuthRegisterPage />within theAppLayoutcomponent thenthis.contextreturns{muiTheme: someobject}as I'd expect.I'm not a react expert by any means. Am I missing anything?