Skip to content

fix(nextra-theme-docs): make Layout children schema optional - #5037

Open
GitHubGW wants to merge 1 commit into
shuding:mainfrom
GitHubGW:fix/layout-children-schema
Open

fix(nextra-theme-docs): make Layout children schema optional#5037
GitHubGW wants to merge 1 commit into
shuding:mainfrom
GitHubGW:fix/layout-children-schema

Conversation

@GitHubGW

Copy link
Copy Markdown

Fixes #5036

Summary

<Layout> always failed Zod validation because children is stripped via rest destructuring before LayoutPropsSchema.safeParse(), while children was required in the schema.

Change

  • children: reactNodechildren: reactNode.optional() in LayoutPropsSchema

Verification

Built with pnpm pack and installed in a test Next.js + Nextra project; the error no longer occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: <Layout> always throws "Invalid input: expected nonoptional, received undefined → at children"

1 participant