From 78a77cf5605b1821ad2c79b52774a1b2b47e495f Mon Sep 17 00:00:00 2001 From: Palanikannan1437 <73993394+Palanikannan1437@users.noreply.github.com> Date: Thu, 10 Aug 2023 02:50:34 +0530 Subject: [PATCH] improved code structure for extracting props in Tiptap --- apps/app/components/tiptap/index.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/app/components/tiptap/index.tsx b/apps/app/components/tiptap/index.tsx index ddf0fd4cda..da5e0db7a6 100644 --- a/apps/app/components/tiptap/index.tsx +++ b/apps/app/components/tiptap/index.tsx @@ -22,7 +22,20 @@ export interface ITiptapRichTextEditor { debouncedUpdatesEnabled?: boolean; } -const Tiptap = ({ onChange, debouncedUpdatesEnabled, forwardedRef, editable, setIsSubmitting, editorContentCustomClassNames, value, noBorder, borderOnFocus, customClassName }: ITiptapRichTextEditor) => { +const Tiptap = (props: ITiptapRichTextEditor) => { + const { + onChange, + debouncedUpdatesEnabled, + forwardedRef, + editable, + setIsSubmitting, + editorContentCustomClassNames, + value, + noBorder, + borderOnFocus, + customClassName + } = props; + const editor = useEditor({ editable: editable ?? true, editorProps: TiptapEditorProps,