Skip to content
Discussion options

You must be logged in to vote

In the App Router this component is a Server Component unless the file starts with 'use client'. MenuItem's child is a render-prop function, and Next cannot serialize that function across the Server -> Client Component boundary, which is what the error is complaining about.

Make the menu component a Client Component:

'use client'

import { Menu, MenuButton, MenuItem, MenuItems } from '@headlessui/react'
import Link from 'next/link'

export function NavMenu() {
  return (
    <Menu>
      <MenuButton>Terms</MenuButton>
      <MenuItems anchor="bottom">
        <MenuItem>
          {({ close }) => (
            <Link href="/" onClick={close}>
              Read and accept
            </Link>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BethanyDrake
Comment options

Answer selected by BethanyDrake
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants