hyojin / material-ui-datatables

An another React Data tables component.
MIT License
165 stars 58 forks source link

Uncaught TypeError: Cannot read property 'baseTheme' of undefined #54

Open paliwalgaurav opened 7 years ago

paliwalgaurav commented 7 years ago

@hyojin I have some issues when I am using it with v1 package.

Uncaught TypeError: Cannot read property 'baseTheme' of undefined at getStyles (DataTables.js:96) at DataTables.render (DataTables.js:298) at react-dom.js:5257 at measureLifeCyclePerf (react-dom.js:4537) at ReactCompositeComponentWrapper._renderValidatedComponentWithoutOwnerOrContext (react-dom.js:5256) at ReactCompositeComponentWrapper._renderValidatedComponent (react-dom.js:5283) at ReactCompositeComponentWrapper.performInitialMount (react-dom.js:4823) at ReactCompositeComponentWrapper.mountComponent (react-dom.js:4719) at Object.mountComponent (react-dom.js:11551) at ReactCompositeComponentWrapper.performInitialMount (react-dom.js:4832)

even when I am using custom theme created.

I am using v1 beta 4

kdipaolo commented 7 years ago

@paliwalgaurav I was experiencing this same error. I wrapped the data tables component in the Material design MuiThemeProvider component like so to get the table working correctly:

import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider'

      <MuiThemeProvider>
          <DataTables
            height={'auto'}
            ....
        />
        </MuiThemeProvider>
paliwalgaurav commented 7 years ago

@kdipaolo I have already done this. Actually, the main container of the website is inside MuiThemeProvider tag.

hyojin commented 7 years ago

It looks like they've changed the way theme works on v1. I'll start investigation soon.

eromoe commented 7 years ago

Got Uncaught TypeError: Cannot read property 'baseTheme' of undefined too

version: ^0.18.2

I didn't use custom theme

eromoe commented 7 years ago

OK, I understand the v1 migration means

    "material-ui": "^1.0.0-beta.6",
    "material-ui-datatables": "^0.18.2",
    "material-ui-icons": "^1.0.0-beta.5",
sugandhgoyal commented 6 years ago

I am also getting the same error after wrapping the whole component in one MuiThemeProvider muiTheme={getMuiTheme()}

andyweiss1982 commented 6 years ago

has anyone found a solution for this?