material-ui-datatables icon indicating copy to clipboard operation
material-ui-datatables copied to clipboard

Uncaught TypeError: Cannot read property 'baseTheme' of undefined

Open paliwalgaurav opened this issue 8 years ago • 7 comments

@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

paliwalgaurav avatar Aug 09 '17 10:08 paliwalgaurav

@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>

kdipaolo avatar Aug 21 '17 18:08 kdipaolo

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

paliwalgaurav avatar Aug 22 '17 06:08 paliwalgaurav

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

hyojin avatar Aug 28 '17 04:08 hyojin

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

version: ^0.18.2

I didn't use custom theme

eromoe avatar Aug 28 '17 08:08 eromoe

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",

eromoe avatar Aug 28 '17 08:08 eromoe

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

sugandhgoyal avatar Dec 28 '17 12:12 sugandhgoyal

has anyone found a solution for this?

andyweiss1982 avatar Feb 13 '18 21:02 andyweiss1982