Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

155
Views
Nextjs Head in _app.js overwriting Head in child component

In my nextjs app I have a Head tag in _app.js as

<GoogleReCaptchaProvider reCaptchaKey={CAPTCHA_SECRET}>
  <Head>
    <html lang="en"></html>
  </Head>
  <DndProvider backend={HTML5Backend}>
    <HttpsRedirect>
      <Fragment>
        <Component {...pageProps} />
        <ToastContainer />
      </Fragment>
    </HttpsRedirect>
  </DndProvider>
</GoogleReCaptchaProvider>

For the lang attribute in html on all pages but in my child component called Layout which renders the component of all pages I also have a Head tag as

<Head>
    <head>
      <title>{title}</title>
      {inject_divs}
      <meta
        name="viewport"
        content="width=device-width,initial-scale=1,maximum-scale=1"
      />
    </head>
  </Head>

Whenever I remove the Head inside _app.js the Head tag inside Layout component works but when I keep the Head in _app.js the Layout Head gets overwritten, Is there a way by which I can use both?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!