Skip to content

React19 - Document Metadata feature #1379

Closed
@JavierScars

Description

@JavierScars
  • @testing-library/react version: 16.2.0
  • Testing Framework and version: Jest 29.7.0
  • DOM Environment: 29.7.0
  • Next Version: 15.1.4

Relevant code or config:

    import Head from 'next/head';
    ....
    ....
    <Head>
      <meta name="twitter:description" content={mySiteName} />
      <link rel="icon" href={faviconUrl} type="image/png" sizes="64x64" data-testid="favicon" />
    </Head>

What you did:

I updated React to v19

What happened:

After updating to React19 I found out that my tests related to stuff in the Head tag were all failing. When I did screen.debug(), I found out that no meta or link tags were being rendered in the <div data-role="head"> Next tag (as it does with React18). This is probably related to how react handles meta tags on V19 (https://react.dev/blog/2024/12/05/react-19#support-for-metadata-tags)

Problem description:

We cannot test anything inside the head tag anymore.

P.S: I don't know if this is the right place to ask for help about this, let me know if you think i should actually file an issue in the react or next project instead :c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions