Created
February 5, 2023 16:03
-
-
Save Lahirutech/e0f54602b651bc172987197dd73e230e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import '@/styles/globals.css'; | |
import Head from 'next/head'; | |
import { AppProps } from 'next/app'; | |
import { ThemeProvider } from '@mui/material/styles'; | |
import CssBaseline from '@mui/material/CssBaseline'; | |
import { CacheProvider, EmotionCache } from '@emotion/react'; | |
import theme from '../theme'; | |
import createEmotionCache from '../createEmotionCache'; | |
// Client-side cache, shared for the whole session of the user in the browser. | |
const clientSideEmotionCache = createEmotionCache(); | |
interface MyAppProps extends AppProps { | |
emotionCache?: EmotionCache; | |
} | |
export default function MyApp(props: MyAppProps) { | |
const { Component, emotionCache = clientSideEmotionCache, pageProps } = props; | |
return ( | |
<CacheProvider value={emotionCache}> | |
<Head> | |
<meta | |
name='viewport' | |
content='initial-scale=1, width=device-width' | |
/> | |
</Head> | |
<ThemeProvider theme={theme}> | |
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. | |
remove the margins of all browsers and apply the material design background color */} | |
<CssBaseline /> | |
<Component {...pageProps} /> | |
</ThemeProvider> | |
</CacheProvider> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment