Fixes #9888. Field permissions were not being passed into custom components. This led to custom components, such as arrays and blocks, unable to render default Payload fields. This was because their props lacked the permissions object required for rendering. For example: ```ts 'use client' import type { ArrayFieldClientComponent } from 'payload' import { ArrayField } from '@payloadcms/ui' export const MyArray: ArrayFieldClientComponent = (props) => <ArrayField {...props} /> ``` In this example the array field itself would render, but the fields within each row would not, because the array field did not pass its permissions down to the rows.
12 lines
310 B
TypeScript
12 lines
310 B
TypeScript
import type { TextFieldServerComponent } from 'payload'
|
|
|
|
import { TextField } from '@payloadcms/ui'
|
|
|
|
export const CustomTextField: TextFieldServerComponent = ({ clientField, path }) => {
|
|
return (
|
|
<div id="custom-text-field">
|
|
<TextField field={clientField} path={path as string} />
|
|
</div>
|
|
)
|
|
}
|