Hi, i am a noob in next js and react, and i am trying to connect menu drupal to my nextjs app.
I have an issue with :
Here the code of my layout : TypeError: Cannot read property 'main' of undefined
I don't understand why, and what i do wrong.
If you can help me, will be great π
Thanks all.
import * as React from "react"
import Link from "next/link"
import { PreviewAlert } from "components/preview-alert"
import { MenuMain } from "components/menu-main"
import { DrupalMenuLinkContent } from "next-drupal"
export interface LayoutProps {
menus: {
main: DrupalMenuLinkContent[]
}
}
export function Layout({ menus, children, ...props }: LayoutProps) {
return (
<>
<PreviewAlert />
<div className="max-w-screen">
<header>
<MenuMain items={menus.main} />
</header>
<main className="container py-10 mx-auto">{children}</main>
</div>
</>
)
}