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 11import { useLayoutEffect , useRef } from 'react'
2- import type { RefObject } from 'react'
2+ import type { MutableRefObject } from 'react'
33import { EditorView , ViewUpdate } from '@codemirror/view'
44import { Compartment , Extension } from '@codemirror/state'
55import { createEditorView , replaceWholeDoc } from '@ui-schema/kit-codemirror/createEditorView'
@@ -33,7 +33,8 @@ export const useCodeMirror = (
3333 // Callback for editor lifecycle events.
3434 onViewLifecycle ?: CodeMirrorOnViewLifeCycle
3535 } ,
36- ) : [ RefObject < EditorView | null > , Compartment ] => {
36+ // eslint-disable-next-line @typescript-eslint/no-deprecated
37+ ) : [ MutableRefObject < EditorView | null > , Compartment ] => {
3738 const editorRef = useRef < EditorView | null > ( null )
3839
3940 const onChangeRef = useRef ( onChange )
Original file line number Diff line number Diff line change 11import { Compartment , Extension , StateEffect } from '@codemirror/state'
22import { EditorView } from '@codemirror/view'
33import { useLayoutEffect , useRef } from 'react'
4- import type { RefObject } from 'react'
4+ import type { MutableRefObject } from 'react'
55
66type SetupExtension = ( ( ) => Extension ) | Extension
77
88export const useExtension = (
99 setupExtension : SetupExtension ,
10- editorRef : RefObject < EditorView | null > ,
10+ // eslint-disable-next-line @typescript-eslint/no-deprecated
11+ editorRef : MutableRefObject < EditorView | null > ,
1112) => {
1213 const configuredRef = useRef < { view : EditorView , cb : SetupExtension } | null > ( null )
1314 const compartmentRef = useRef < Compartment > ( new Compartment ( ) )
You can’t perform that action at this time.
0 commit comments