Skip to content

Docs: Where I suppose to import LayoutProps from? #53973

Description

@yordis

What is the improvement or update you wish to see?

I am getting some TypeScript error about a LayoutProps typespec, which I couldn't find the documentation and where it suppose to come from. I searched for "LayoutProps."

The IDE autocompletes the type to be imported from .next/types/app/layout.ts file but feels extremely odd since that is generated at build time, and the build time requires such a file (feels like a cyclical situation to some extent).

So, I am not sure what the recommendation is here.

Is there any context that might help us understand?

Error:

@webapps/web1:build: app/layout.tsx
@webapps/web1:build: Type error: Type '{ children?: ReactNode; }' does not satisfy the constraint 'LayoutProps'.
@webapps/web1:build:   Property 'types' is missing in type '{ children?: ReactNode; }' but required in type 'LayoutProps'.
@webapps/web1:build:
@webapps/web1:build: ERROR: command finished with error: command (/Users/ubi/Developer/github.com/straw-hat-team/nextjs-starter-kit/webapps/web1) yarn run build exited (1)

app/layout.tsx file:

import "@/styles/index.css";
import { PropsWithChildren } from "react";

export default function Layout(props: PropsWithChildren<{}>) {
  console.log("Have a great day! 📣🐢");
  console.log("Check this amazing material: https://bit.ly/3se7YYw");

  return (
    <html className="box-border scroll-smooth antialiased" lang="en">
      <body className="bg-white font-sans text-lg font-normal tracking-normal text-gray-700 dark:bg-gray-800 dark:text-gray-300 sm:text-2xl">
        {props.children}
      </body>
    </html>
  );
}

Does the docs page already exist? Please link to it.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationRelated to Next.js' official documentation.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions