title: ReactJS Material UI withStyles incl. theme in TS
body: <p>I tried to convert the Material UI Dashboard into TypeScript. <a href="https://github.com/mui-org/material-ui/blob/master/docs/src/pages/page-layout-examples/dashboard/Dashboard.js" rel="nofollow noreferrer">https://github.com/mui-org/material-ui/blob/master/docs/src/pages/page-layout-examples/dashboard/Dashboard.js</a></p>
  
  <p>Currently I'm facing the problem that the CSS style definitions cannot be set on withStyles function when exporting the Dashboard. </p>
  
  <pre><code>const styles = (theme: Theme) =&gt; ({
    root: {
      display: 'flex',
    },
    toolbar: {
      paddingRight: 24, // keep right padding when drawer closed
    },
    toolbarIcon: {
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'flex-end',
      padding: '0 8px',
      ...theme.mixins.toolbar,
    },
    appBar: {
      zIndex: theme.zIndex.drawer + 1,
      transition: theme.transitions.create(['width', 'margin'], {
        easing: theme.transitions.easing.sharp,
        duration: theme.transitions.duration.leavingScreen,
      }),
    },
    .....
  });
  </code></pre>
  
  <p>If I correctly understand, I need this theme reference to adjust the style to the current Theme. But how do I get the current theme when calling the style function? </p>
  
  <pre><code>export default withStyles(styles(/*WHAT TO PUT IN HERE?*/))(Dashboard);
  </code></pre>