Argument of type '(from: number, to: number) => boolean' is not assignable to parameter of type 'null'.ts(2345)

21 views Asked by At

when I tried to remove the codemirror6 select text followed docs https://codemirror.net/docs/migration/#marked-text:

const highlightUnselection = (f: number, t: number) => {
    if (!curEditorView) {
        return;
    }
    const filterMarks = StateEffect.define()
    if(f&&t){
        curEditorView.dispatch({
            effects: filterMarks.of((from: number, to: number) => to <= f || from >= t)
        })
    }
}

shows error like this:

Argument of type '(from: number, to: number) => boolean' is not assignable to parameter of type 'null'.ts(2345)

Am I missing something? what should I do to fixed this issue?

0

There are 0 answers