Skip to content

Commit

Permalink
[๐Ÿšจ fix] viewport meta ๊ฒฝ๊ณ  ํ•ด๊ฒฐ์„ ์œ„ํ•œ ํƒœ๊ทธ ์œ„์น˜ ์ด๋™
Browse files Browse the repository at this point in the history
- Warning: viewport meta tags should not be used in _document.js's <Head>. https://nextjs.org/docs/messages/no-document-viewport-meta
- viewport๋ฅผ _document.js ์—์„œ ์ž‘์„ฑํ•˜๋Š” ๊ฒฝ์šฐ ์˜ˆ์ƒ์น˜ ๋ชปํ•œ ๊ฒฐ๊ณผ๋ฅผ ์–ป์„ ์ˆ˜ ์žˆ์œผ๋‹ˆ _app.js ์—์„œ ์ž‘์„ฑํ•˜๊ธธ ๊ถŒ์žฅ
  • Loading branch information
sryung1225 committed Apr 21, 2024
1 parent 428ceba commit 3cf8a6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { useState, useEffect } from 'react';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { useRouter } from 'next/router';
import Head from 'next/head';
import Script from 'next/script';
import theme from '@/styles/theme';
import global from '@/styles/global';
Expand Down Expand Up @@ -36,6 +37,12 @@ export default function App({ Component, pageProps }: AppProps) {
<Global styles={global} />
{process.env.NODE_ENV === 'production' && (
<>
<Head>
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
</Head>
<Script
strategy="afterInteractive"
src={`https://www.googletagmanager.com/gtag/js?id=${gtag.GA_TRACKING_ID}`}
Expand Down
4 changes: 0 additions & 4 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ export default function Document() {
return (
<Html lang="ko">
<Head>
<meta
name="viewport"
content="width=device-width, initial-scale=1, viewport-fit=cover"
/>
<meta property="og:image" content="/app-assets/og-image.png" />
<meta name="theme-color" content={color.WHITE} />
<meta name="msapplication-TileColor" content={color.NORMAL} />
Expand Down

0 comments on commit 3cf8a6e

Please sign in to comment.