title: React Material UI : 'theme' is not defined no-undef
body: <p>I am creating a simple react application using material-ui. I am using MuiThemeProvider and ThemeProvider for theme. </p>
  
  <p>App.js</p>
  
  <pre><code>import React from 'react';
  import { createMuiTheme,  MuiThemeProvider } from '@material-ui/core/styles';
  import { ThemeProvider } from '@material-ui/styles';
  import { CssBaseline } from '@material-ui/core';
  import { Topic } from './dashboard/components/drawer/topic.js' 
  
  const theme = createMuiTheme({
      palette : {
          type : 'dark',
          background : {
              default : "#000000"
          },
          secondary : {
              main : '#E19A4C'
          }
      }
  })
  
  function App() {
      return (
          &lt; MuiThemeProvider theme={theme}&gt;
              &lt;ThemeProvider theme={theme}&gt;
                  &lt;CssBaseline /&gt;
                  &lt;div className="App"&gt;
                      &lt;Dashboard /&gt;
                      &lt;Topic /&gt;
                  &lt;/div&gt;
              &lt;/ThemeProvider&gt;
          &lt;/ MuiThemeProvider&gt;
      );
  }
  
  export default App;
  </code></pre>
  
  <p>Topic.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import { Typography, makeStyles, Box, Paper } from '@material-ui/core';
  
  const style = makeStyles(theme =&gt; ({
      paper : {
          background : '#ff00ff'
      }
  }))
  
  export const Topic = (props) =&gt; {
  
      const classes = style()
  
      return (
          &lt;div&gt;
              &lt;Paper className={classes.box}&gt;
                  &lt;Typography variant="h6" component="h6" gutterBottom&gt;
                      {props.data}
                  &lt;/Typography&gt;
              &lt;/Paper&gt;
          &lt;/div&gt;
      )
  }
  
  export default Topic
  </code></pre>
  
  <p>I am getting error <code>Uncaught ReferenceError: theme is not defined</code></p>
  
  <p>I have tried { withTheme : true } in makeStyles but it doesn't work. </p>
  
  <p>Sending theme as props works but is not recommended. 
  Can Someone please help?</p>