improved code structure for extracting props in Tiptap

This commit is contained in:
Palanikannan1437 2023-08-10 02:50:34 +05:30
parent 96ef0a1e4f
commit 78a77cf560

View File

@ -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,