### What? Make the document `id` available to server-rendered admin components that expect it—specifically `EditMenuItems` and `BeforeDocumentControls`—so `props.id` matches the official docs. ### Why? The docs show examples using `props.id`, but the runtime `serverProps` and TS types didn’t include it. This led to `undefined` at render time. ### How? - Add id to ServerProps and set it in renderDocumentSlots from req.routeParams.id. Fixes #13420
14 lines
300 B
TypeScript
14 lines
300 B
TypeScript
import type { EditMenuItemsServerProps } from 'payload'
|
|
|
|
import React from 'react'
|
|
|
|
export const EditMenuItemsServer = (props: EditMenuItemsServerProps) => {
|
|
const href = `/custom-action?id=${props.id}`
|
|
|
|
return (
|
|
<div>
|
|
<a href={href}>Custom Edit Menu Item (Server)</a>
|
|
</div>
|
|
)
|
|
}
|