File tree 1 file changed +6
-4
lines changed
packages/kit-codemirror/src/CodeMirror
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -13,22 +13,21 @@ export interface CodeMirrorComponentProps {
13
13
style ?: React . CSSProperties
14
14
}
15
15
16
- export interface CodeMirrorProps extends CodeMirrorComponentProps {
16
+ export interface CodeMirrorProps extends CodeMirrorComponentProps , Omit < React . HTMLProps < HTMLDivElement > , 'onChange' | 'value' > {
17
17
onViewLifecycle ?: CodeMirrorOnViewLifeCycle
18
18
onExternalChange ?: CodeMirrorOnExternalChange
19
19
className ?: string
20
20
}
21
21
22
22
export const CodeMirror : React . FC < CodeMirrorProps > = (
23
23
{
24
- className,
25
24
classNamesContent,
26
25
onChange,
27
26
onViewLifecycle, onExternalChange,
28
27
value = '' ,
29
- style,
30
28
extensions,
31
29
effects,
30
+ ...props
32
31
} ,
33
32
) => {
34
33
const containerRef = React . useRef < HTMLDivElement | null > ( null )
@@ -54,5 +53,8 @@ export const CodeMirror: React.FC<CodeMirrorProps> = (
54
53
// to be able to dispatch the correct effects
55
54
useEditorClasses ( editorAttributesCompartment . current , editor , classNamesContent )
56
55
57
- return < div className = { className } style = { style } ref = { containerRef } />
56
+ return < div
57
+ ref = { containerRef }
58
+ { ...props }
59
+ />
58
60
}
You can’t perform that action at this time.
0 commit comments