mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-12 04:33:34 +08:00
fix: fix editor type for ReactRenderer
This commit is contained in:
parent
134d7f8513
commit
2af187023d
@ -1,5 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Editor } from './Editor'
|
import { Editor } from '@tiptap/core'
|
||||||
|
import { Editor as ExtendedEditor } from './Editor'
|
||||||
|
|
||||||
function isClassComponent(Component: any) {
|
function isClassComponent(Component: any) {
|
||||||
return !!(
|
return !!(
|
||||||
@ -30,7 +31,7 @@ type ComponentType =
|
|||||||
export class ReactRenderer {
|
export class ReactRenderer {
|
||||||
id: string
|
id: string
|
||||||
|
|
||||||
editor: Editor
|
editor: ExtendedEditor
|
||||||
|
|
||||||
component: any
|
component: any
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ export class ReactRenderer {
|
|||||||
constructor(component: ComponentType, { editor, props = {}, as = 'div' }: ReactRendererOptions) {
|
constructor(component: ComponentType, { editor, props = {}, as = 'div' }: ReactRendererOptions) {
|
||||||
this.id = Math.floor(Math.random() * 0xFFFFFFFF).toString()
|
this.id = Math.floor(Math.random() * 0xFFFFFFFF).toString()
|
||||||
this.component = component
|
this.component = component
|
||||||
this.editor = editor
|
this.editor = editor as ExtendedEditor
|
||||||
this.props = props
|
this.props = props
|
||||||
this.element = document.createElement(as)
|
this.element = document.createElement(as)
|
||||||
this.element.classList.add('react-renderer')
|
this.element.classList.add('react-renderer')
|
||||||
|
Loading…
Reference in New Issue
Block a user