Next.js Discord

Discord Forum

meta viewport content fixed width not working

Unanswered
peko3278 posted this in #help-forum
Open in Discord
Added <meta name="viewport" content="width=600" /> into _app.tsx but is not being applied. Seeing the html source in chrome dev tools it shows the tag tho so i don't know what's wrong.

This is how my file looks, Head tag is imported from next/head

const spaceGrotesk = Space_Grotesk({ subsets: ['latin'], variable: '--font-space-grotesk', }); const App = (props: AppPropsWithLayout): JSX.Element => { const { Component, pageProps: { session, ...pageProps }, } = props; const Layout = Component.Layout ?? NoLayout; return ( <main className={${spaceGrotesk.variable} font-sans}> <Head> <meta name="viewport" content="width=600" /> </Head> <Layout> <Component {...pageProps} /> </Layout> </main> ); }; export default trpc.withTRPC(App);

0 Replies