From 6f82154ce42954c80cb2f50ba0254950a6a1fe6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Jablo=C3=B1ski?= <43938777+GermanJablo@users.noreply.github.com> Date: Thu, 5 Jun 2025 11:12:00 -0300 Subject: [PATCH] fix(richtext-lexical): prevent runtime error if using TextStateFeature without props (#12668) TextStateFeature wasn't intended to be used without props, but it still shouldn't throw a runtime error if used that way. Perhaps some users are experimenting until they decide on the props. Fixes #12518 --- .../richtext-lexical/src/features/textState/feature.server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/richtext-lexical/src/features/textState/feature.server.ts b/packages/richtext-lexical/src/features/textState/feature.server.ts index 61768bd86..cf6ab1446 100644 --- a/packages/richtext-lexical/src/features/textState/feature.server.ts +++ b/packages/richtext-lexical/src/features/textState/feature.server.ts @@ -69,7 +69,7 @@ export const TextStateFeature = createServerFeature< return { ClientFeature: '@payloadcms/richtext-lexical/client#TextStateFeatureClient', clientFeatureProps: { - state: props.state, + state: props?.state, }, } },