After recently updating my material-ui to version 0.15.4, I encountered an issue while trying to make it work. The error message states that getMuiTheme is not a function, despite the fact that the relevant JavaScript file is present in the folder location. I have also verified and updated my React to version 15.3.1, ruling out any potential dependency issues. However, I am still unable to pinpoint the underlying problem.
Below is a snippet of the code:
var React = require('react'),
mui = require('material-ui'),
getMuiTheme = require('material-ui/styles/getMuiTheme'),
LoginDialog = require('./login-dialog.jsx'),
RaisedButton = mui.RaisedButton,
MuiThemeProvider = require('material-ui/styles/MuiThemeProvider'),
darkBaseTheme = require('material-ui/styles/baseThemes/darkBaseTheme');
var Index = React.createClass({
getChildContext: function() {
return {
muiTheme: getMuiTheme(darkBaseTheme),
};
},
childContextTypes: {
muiTheme: React.PropTypes.object
},
render: function() {
return (
<div className="mui-app-canvas home-page-background">
<RaisedButton
className="login-button"
label="Login"
onTouchTap={ this._handleLoginDialog }
linkButton={ false } />
<LoginDialog
ref="loginDialog"
loginUrl={ this.props.loginUrl } />
</div>
)
},
_handleLoginDialog: function() {
this.refs.loginDialog.show();
}
});
module.exports = Index;