From 98f40e45523cca1ba46fd7e0c6926daf0e8ab9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=C3=A1=C5=A1=20Nobile?= Date: Mon, 13 May 2024 16:34:48 +0200 Subject: [PATCH] fix(playground): use relative content field name in PlateContentSync --- .../components/richt-text-editor/plate-editor.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/playground/admin/lib/components/richt-text-editor/plate-editor.tsx b/packages/playground/admin/lib/components/richt-text-editor/plate-editor.tsx index 4ec569743..a3768c44a 100644 --- a/packages/playground/admin/lib/components/richt-text-editor/plate-editor.tsx +++ b/packages/playground/admin/lib/components/richt-text-editor/plate-editor.tsx @@ -42,7 +42,7 @@ export const PlateEditor = Component( onChange={handleEditorOnChange} normalizeInitialValue > - +
{ - const field = useField('data') - const fieldAccessor = field.getAccessor - const fieldValue = field.value +interface PlateContentSyncProps { + field: string | SugarableRelativeSingleField +} + +const PlateContentSync = ({ field }: PlateContentSyncProps) => { + const contentField = useField(field) + const fieldAccessor = contentField.getAccessor + const fieldValue = contentField.value const editor = useEditorRef() useEffect(() => {