Skip to content

Commit 19e2f10

Browse files
authored
fix(richtext-lexical): regression in lexical blocks (#8378)
Fix #8371
1 parent bd41b4d commit 19e2f10

File tree

2 files changed

+1
-7
lines changed
  • packages
    • richtext-lexical/src/features/blocks/client/component
    • ui/src/providers/DocumentInfo

2 files changed

+1
-7
lines changed

packages/richtext-lexical/src/features/blocks/client/component/index.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ export const BlockComponent: React.FC<Props> = (props) => {
5757
// Field Schema
5858
useEffect(() => {
5959
const awaitInitialState = async () => {
60-
if (!id) {
61-
return
62-
}
6360
const { state } = await getFormState({
6461
apiRoute: config.routes.api,
6562
body: {
@@ -90,9 +87,6 @@ export const BlockComponent: React.FC<Props> = (props) => {
9087

9188
const onChange = useCallback(
9289
async ({ formState: prevFormState }) => {
93-
if (!id) {
94-
throw new Error('No ID found')
95-
}
9690
const { state: formState } = await getFormState({
9791
apiRoute: config.routes.api,
9892
body: {

packages/ui/src/providers/DocumentInfo/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type DocumentInfoProps = {
3131
readonly globalSlug?: SanitizedGlobalConfig['slug']
3232
readonly hasPublishPermission?: boolean
3333
readonly hasSavePermission?: boolean
34-
readonly id: null | number | string
34+
readonly id?: number | string
3535
readonly initialData?: Data
3636
readonly initialState?: FormState
3737
readonly isEditing?: boolean

0 commit comments

Comments
 (0)