Skip to content

Test layout.tsx file without having validateDOMNesting warning #1250

Closed
@mezzouhri

Description

@mezzouhri

Describe the feature you'd like:

As a user of react 18 with NextJS (with app directory), I would like to test routLayout.tsx file without having this warning : Warning: validateDOMNesting(...): <html> cannot appear as a child of <div>. at html at children

//routLayout.tsx:

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="fr" data-testid="rout-layout">
      <body className={inter.className}>{children}</body>
    </html>
  );
}

Suggested implementation:

Maybe by modifying the container options

Thank you so much for your help

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