@@ -5,25 +5,27 @@ import React, {
5
5
forwardRef ,
6
6
CSSProperties ,
7
7
} from 'react' ;
8
- import { EditorView , DirectEditorProps } from 'prosemirror-view' ;
8
+ import {
9
+ EditorView ,
10
+ EditorProps ,
11
+ DirectEditorProps ,
12
+ } from 'prosemirror-view' ;
9
13
import { EditorState } from 'prosemirror-state' ;
10
14
import { Schema } from 'prosemirror-model' ;
11
15
12
16
export interface Handle {
13
17
view : EditorView ;
14
18
}
15
19
16
- interface Props < S extends Schema = any >
17
- extends Partial < DirectEditorProps < S > > {
20
+ interface Props < S extends Schema = any > extends EditorProps < S > {
18
21
state : EditorState < S > ;
19
22
onChange : ( state : EditorState ) => void ;
20
23
style ?: CSSProperties ;
21
24
className ?: string ;
22
25
}
23
26
24
27
export default forwardRef < Handle , Props > ( function ProseMirror (
25
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
26
- { dispatchTransaction, onChange, style, className, ...props } ,
28
+ { onChange, style, className, ...props } ,
27
29
ref ,
28
30
) : JSX . Element {
29
31
const root = useRef < HTMLDivElement > ( null ! ) ;
@@ -48,7 +50,10 @@ export default forwardRef<Handle, Props>(function ProseMirror(
48
50
} ,
49
51
} ) ) ;
50
52
return < div ref = { root } style = { style } className = { className } /> ;
51
- function buildProps ( props : DirectEditorProps ) : DirectEditorProps {
53
+
54
+ function buildProps (
55
+ props : Omit < DirectEditorProps , 'dispatchTransaction' > ,
56
+ ) : DirectEditorProps {
52
57
return {
53
58
...props ,
54
59
dispatchTransaction : transaction => {
0 commit comments