feat: update theme provider to dynamic

This commit is contained in:
QiShaoXuan 2022-09-30 11:40:10 +08:00
parent cb432a8892
commit 71e60bc3a5
2 changed files with 7 additions and 1 deletions

View File

@ -1,8 +1,12 @@
import type { AppProps } from 'next/app';
import { ThemeProvider } from '@/styles';
import dynamic from 'next/dynamic';
import '../../public/globals.css';
const ThemeProvider = dynamic(() => import('@/styles/themeProvider'), {
ssr: false,
});
function MyApp({ Component, pageProps }: AppProps) {
return (
<ThemeProvider>

View File

@ -75,3 +75,5 @@ export const ThemeProvider = ({
</ThemeContext.Provider>
);
};
export default ThemeProvider;