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.
11 lines
329 B
TypeScript
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>
|
|
}
|