diff --git a/packages/vue-3/src/useEditor.ts b/packages/vue-3/src/useEditor.ts index 2e6a64d1..20a1c409 100644 --- a/packages/vue-3/src/useEditor.ts +++ b/packages/vue-3/src/useEditor.ts @@ -1,9 +1,15 @@ -import { onMounted, onBeforeUnmount, shallowRef } from 'vue' +import { + onMounted, + onBeforeUnmount, + shallowRef, + Ref, +} from 'vue' import { EditorOptions } from '@tiptap/core' import { Editor } from './Editor' -export const useEditor = (options: Partial = {}) => { - const editor = shallowRef() +// We set a custom return type. Otherwise TypeScript will throw TS4023. Not sure why. +export const useEditor = (options: Partial = {}): Ref => { + const editor = shallowRef() as Ref onMounted(() => { editor.value = new Editor(options)