title: Applying type: 'dark' to a MUI palette breaks my site unless it is defined directly in the createMuiTheme() function
body: <p>I am unable to define a 'dark' theme with MUI for my site when declaring <code>type: 'dark'</code> anywhere outside of the direct <code>createMuiTheme()</code> funciton.</p>
  
  <p>For example, the following works:</p>
  
  <pre><code>const siteTheme = createMuiTheme({
    palette: {
      primary: {
        light: '#484848',
        main: '#212121',
        dark: '#000000',
        contrastText: '#fff',
      },
      secondary: {
        light: '#b0ff57',
        main: '#76ff03',
        dark: '#32cb00',
        contrastText: '#000',
      },
      type: 'dark'
    },
  })
  </code></pre>
  
  <p>But the following breaks:</p>
  
  <pre><code>const theme = {
    palette: {
      primary: {
        light: '#484848',
        main: '#212121',
        dark: '#000000',
        contrastText: '#fff',
      },
      secondary: {
        light: '#b0ff57',
        main: '#76ff03',
        dark: '#32cb00',
        contrastText: '#000',
      },
      type: 'dark'
    },
  }
  
  const siteTheme = createMuiTheme(theme)
  </code></pre>
  
  <p>And the error it gives is </p>
  
  <blockquote>
    <p>54 | const siteTheme = createMuiTheme(theme)</p>
    
    <p>Argument of type '{ palette: { primary: { light: string; main: string; dark: string; contrastText: string; }; secondary: { light: string; main: string; dark: string; contrastText: string; }; type: string; }; }' is not assignable to parameter of type 'ThemeOptions'.
      Types of property 'palette' are incompatible.
        Type '{ primary: { light: string; main: string; dark: string; contrastText: string; }; secondary: { light: string; main: string; dark: string; contrastText: string; }; type: string; }' is not assignable to type 'PaletteOptions'.
          Types of property 'type' are incompatible.
            Type 'string' is not assignable to type '"dark" | "light" | undefined'.ts(2345)</p>
  </blockquote>
  
  <p>I am using a <code>.tsx</code> file.</p>
  
  <p>Why can I not define <code>type = 'dark'</code> outside of the direct <code>createMuiTheme()</code> function?</p>