Files
payload/test/fields/collections/Lexical/blockComponents/BlockComponentRSC.tsx
Alessio Gravili 9e31e17e31 feat(richtext-lexical): more powerful custom Block RSCs, improved selection handling (#9422)
Now, custom Lexical block & inline block components are re-rendered if
the fields drawer is saved. This ensures that RSCs receive the updated
values, without having to resort to a client component that utilizes the
`useForm` hook.

Additionally, this PRs fixes the lexical selection jumping around after
opening a Block or InlineBlock drawer and clicking inside of it.
2024-11-22 02:34:29 +00:00

11 lines
329 B
TypeScript

import type { BlocksFieldServerComponent } from 'payload'
import { BlockCollapsible } from '@payloadcms/richtext-lexical/client'
import React from 'react'
export const BlockComponentRSC: BlocksFieldServerComponent = (props) => {
const { data } = props
return <BlockCollapsible>Data: {data?.key ?? ''}</BlockCollapsible>
}