From b5b9363b49ecf64550c9df707b02d02854cc8c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Fri, 5 Nov 2021 13:45:16 +0100 Subject: [PATCH] fix vue-3 build --- packages/vue-3/src/useEditor.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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)