File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
packages/kit-codemirror/src Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { useLayoutEffect , useRef } from 'react'
2
- import type { RefObject } from 'react'
2
+ import type { MutableRefObject } from 'react'
3
3
import { EditorView , ViewUpdate } from '@codemirror/view'
4
4
import { Compartment , Extension } from '@codemirror/state'
5
5
import { createEditorView , replaceWholeDoc } from '@ui-schema/kit-codemirror/createEditorView'
@@ -33,7 +33,8 @@ export const useCodeMirror = (
33
33
// Callback for editor lifecycle events.
34
34
onViewLifecycle ?: CodeMirrorOnViewLifeCycle
35
35
} ,
36
- ) : [ RefObject < EditorView | null > , Compartment ] => {
36
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
37
+ ) : [ MutableRefObject < EditorView | null > , Compartment ] => {
37
38
const editorRef = useRef < EditorView | null > ( null )
38
39
39
40
const onChangeRef = useRef ( onChange )
Original file line number Diff line number Diff line change 1
1
import { Compartment , Extension , StateEffect } from '@codemirror/state'
2
2
import { EditorView } from '@codemirror/view'
3
3
import { useLayoutEffect , useRef } from 'react'
4
- import type { RefObject } from 'react'
4
+ import type { MutableRefObject } from 'react'
5
5
6
6
type SetupExtension = ( ( ) => Extension ) | Extension
7
7
8
8
export const useExtension = (
9
9
setupExtension : SetupExtension ,
10
- editorRef : RefObject < EditorView | null > ,
10
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
11
+ editorRef : MutableRefObject < EditorView | null > ,
11
12
) => {
12
13
const configuredRef = useRef < { view : EditorView , cb : SetupExtension } | null > ( null )
13
14
const compartmentRef = useRef < Compartment > ( new Compartment ( ) )
You can’t perform that action at this time.
0 commit comments