Skip to content

Change EditViewMenuItemClientProps to EditViewMenuItemsClientProps #15898

@h16nning

Description

@h16nning

Documentation Issue

The code example at Edit View > Custom Components > editMenuItems > Client Component refers to a type "EditViewMenuItemClientProps" twice. This type doesn't exist, it should be EditViewMenuItem**s**ClientProps.

'use client'

import React from 'react'
import { PopupList } from '@payloadcms/ui'

import type { EditViewMenuItemClientProps } from 'payload'

export const EditMenuItems = (props: EditViewMenuItemClientProps) => {
  const handleClick = () => {
    console.log('Custom button clicked!')
  }

  return (
    <PopupList.ButtonGroup>
      <PopupList.Button onClick={handleClick}>
        Custom Edit Menu Item
      </PopupList.Button>
      <PopupList.Button onClick={handleClick}>
        Another Custom Edit Menu Item - add as many as you need!
      </PopupList.Button>
    </PopupList.ButtonGroup>
  )
}

The server component gets it right.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions