title: Material-ui withTheme() giving error "TypeError: Object(...) is not a function"
body: <h1>EDIT: I installed the v1.0.0.36 beta version and copied the sample from that versions docs (which looks identical to me) and it worked straight away. Not sure what the problem was but thanks for replies</h1>
  <p>I am trying to use Material-UI's withTheme to access the theme in a component.</p>
  <p>I have followed the sample in the <a href="https://material-ui-next.com/customization/themes/#accessing-the-theme-in-a-component" rel="nofollow noreferrer">docs</a> which goes through the create-react-app packager ok but in the browser gives the error: TypeError: Object(...) is not a function
  and highlights the code line <code>&gt; 17 | export default withTheme()(WithTheme);</code></p>
  <p>I have cut down the sample code to the most basic use of <code>withTheme()</code> and am still receiving this error</p>
  <p><strong>withtheme.js</strong></p>
  <pre><code>import React from 'react';
  import { withTheme } from 'material-ui/styles';
  
  function WithTheme() {
    
      const styles = {
          primaryText: {
              color: 'red',
          }
      };
  
      return (
          &lt;h1 style={styles.primaryText}&gt;Hello&lt;/h1&gt;
      );
  }
  
  export default withTheme()(WithTheme);
  </code></pre>
  <p><strong>EDIT: To help clarify the problem, here is the App.js file.</strong></p>
  <pre><code>import React, { Component } from 'react';
  import './App.css';
  import 'typeface-roboto';
  
  import AppBar from 'material-ui/AppBar';
  
  import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
  import {brown500, brown900} from 'material-ui/styles/colors';
  import getMuiTheme from 'material-ui/styles/getMuiTheme';
  
  import WithTheme from './components/withtheme';
  
  const Theme = getMuiTheme({
    palette: {
      primary1Color: brown900,
      primary2Color: brown500,
    }
  });
  
  class App extends Component {
    render() {
      return (
        &lt;MuiThemeProvider muiTheme={Theme} &gt;
            &lt;AppBar
              title=&quot;Title&quot;
              iconClassNameRight=&quot;muidocs-icon-navigation-expand-more&quot; /&gt;
            &lt;WithTheme /&gt;
        &lt;/MuiThemeProvider&gt;
      );
    }
  }
  
  export default App;
  </code></pre>
  <p>I have customised the theme and changed <code>primary1Color</code> to brown, using muiThemeProvider. This all works fine when I remove the <code>WithTheme</code> component from App.js - the AppBar is brown as expected. The problem is I am getting the error when I try to use the mui <code>withTheme</code> function.</p>
  <p><strong>My intention is to set the h2 in <code>WithTheme</code> component to be whatever color the current theme has for <code>primary1Color</code></strong></p>
  <p>**End Edit</p>
  <p>Any help would be appreciated. Happy to post the (almost) exact copy of the doco sample code which achieves the same error if required.</p>
  <p>Thanks</p>