jkslyby / material-ui-datetime-range-picker

A datetime range picker built off of material-ui
MIT License
18 stars 11 forks source link

React with material-ui v1+ and material-ui-datetime-range-picker not work together. #3

Open v-gachkovsky opened 6 years ago

v-gachkovsky commented 6 years ago

Hi! I'musing react 16 with material-ui v1.3. And I have to use MuiThemeProvider:

const AppRoot = () => {
  return (
    <MuiThemeProvider theme={ theme }>
      <App />
    </MuiThemeProvider>
  );
};

const StyledAppRoot = withStyles(globalStyle)(AppRoot);

const render = () => {
  ReactDOM.render(
    <Provider store={ store }>
      <ConnectedRouter history={ history }>
        <StyledAppRoot />
      </ConnectedRouter>
    </Provider>,
    MOUNT_NODE
  );
};

I tried to install and use material-ui-datetime-range-picker and have got error:

TypeError: Cannot read property 'prepareStyles' of undefined.

How can I fix it?

v-gachkovsky commented 6 years ago

Sorry. You support only material-ui 0.20 version :(

jkslyby commented 6 years ago

While the material-ui-datetime-range-picker is written from the 0.20 version code, you should be able to use it in a project that uses material-ui v1. My project uses v1 inside of a v0.20 MuiThemeProvider so maybe that's the difference? If you could show me how you are trying to use it, I might be able to figure out what's going on.

eurekin commented 5 years ago

Hello. Would like to use that component. Started project from scratch using react starter, added the material core dependency and there is no MuiThemeProvider.