fix(richtext-lexical): regression in lexical blocks (#8378)
Fix https://github.com/payloadcms/payload/issues/8371
This commit is contained in:
@@ -57,9 +57,6 @@ export const BlockComponent: React.FC<Props> = (props) => {
|
||||
// Field Schema
|
||||
useEffect(() => {
|
||||
const awaitInitialState = async () => {
|
||||
if (!id) {
|
||||
return
|
||||
}
|
||||
const { state } = await getFormState({
|
||||
apiRoute: config.routes.api,
|
||||
body: {
|
||||
@@ -90,9 +87,6 @@ export const BlockComponent: React.FC<Props> = (props) => {
|
||||
|
||||
const onChange = useCallback(
|
||||
async ({ formState: prevFormState }) => {
|
||||
if (!id) {
|
||||
throw new Error('No ID found')
|
||||
}
|
||||
const { state: formState } = await getFormState({
|
||||
apiRoute: config.routes.api,
|
||||
body: {
|
||||
|
||||
@@ -31,7 +31,7 @@ export type DocumentInfoProps = {
|
||||
readonly globalSlug?: SanitizedGlobalConfig['slug']
|
||||
readonly hasPublishPermission?: boolean
|
||||
readonly hasSavePermission?: boolean
|
||||
readonly id: null | number | string
|
||||
readonly id?: number | string
|
||||
readonly initialData?: Data
|
||||
readonly initialState?: FormState
|
||||
readonly isEditing?: boolean
|
||||
|
||||
Reference in New Issue
Block a user