Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zIndex: rawTheme.zIndex.leftNav not defined when using getMuiTheme ? #2609

Closed
dcsan opened this issue Dec 20, 2015 · 2 comments
Closed

zIndex: rawTheme.zIndex.leftNav not defined when using getMuiTheme ? #2609

dcsan opened this issue Dec 20, 2015 · 2 comments
Labels
bug 🐛 Something doesn't work

Comments

@dcsan
Copy link

dcsan commented Dec 20, 2015

I'm trying to use a custom theme, and get an error:

Uncaught TypeError: Cannot read property 'leftNav' of undefined

at left-nav.js

    zIndex: rawTheme.zIndex.leftNav,

related to #2527 ?

Adding

AppTheme = {
  zIndex: {
    leftNav: 1000
  },

this to my theme seems to have stopped it crashing, but not sure if there can be a guard for if that property exists?

fyi the code I'm using is around getMuiTheme, not a rawTheme. So i thought that would modify some type of base theme rather than create a new one from scratch.


  childContextTypes: {
    muiTheme: React.PropTypes.object
  },

  getChildContext() {
    return {
      muiTheme: ThemeManager.getMuiTheme(AppTheme)
    };
  },
@oliviertassinari
Copy link
Member

This should be fixed by oliviertassinari@8ade956. Could you try the master branch?

@oliviertassinari oliviertassinari added the bug 🐛 Something doesn't work label Dec 20, 2015
@dcsan
Copy link
Author

dcsan commented Dec 20, 2015

I'm using a build off 14.0-rc2
FYI i'm using a meteor package and not quite sure how to rebuild material-ui from source
meteor packages enable me to point to an npm dependency, but otherwise I think I would have to create a new npm release to use your master... unless there's a build of that somewhere?

https://github.com/dcsan/meteor-material-ui/blob/master/package.js#L14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work
Projects
None yet
Development

No branches or pull requests

2 participants