Skip to content

Commit

Permalink
Merge pull request #63 from Kusitms-29th-ASAP/fix/#62
Browse files Browse the repository at this point in the history
[Fix] SSR 스타일링 풀리는 현상 해결
  • Loading branch information
yyypearl authored May 20, 2024
2 parents ec2b073 + 94666e7 commit 5ef8310
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { QueryClient, QueryClientProvider } from "react-query";
import { Provider } from "react-redux";
import { store } from "@/redux/store";
import "./global.css";
import NOSSR from "@/components/common/NOSSR";

const queryClient = new QueryClient();

Expand All @@ -22,7 +23,9 @@ export default function RootLayout({
<body>
<Provider store={store}>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={theme}>{children}</ThemeProvider>
<ThemeProvider theme={theme}>
<NOSSR>{children}</NOSSR>
</ThemeProvider>
</QueryClientProvider>
</Provider>
</body>
Expand Down
10 changes: 10 additions & 0 deletions src/components/common/NOSSR.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import dynamic from "next/dynamic";
import React from "react";

const NOSSR: React.FC<React.PropsWithChildren> = (props) => (
<>{props.children}</>
);

export default dynamic(() => Promise.resolve(NOSSR), {
ssr: false,
});

0 comments on commit 5ef8310

Please sign in to comment.