How to set readOnly mode and use lineNumbers in Merge View?

my code:

// ...
const initCoderView = (doc: string) => {
    return EditorState.create({
      doc: doc || '',
      extensions: [
        EditorView.editable.of(false), 
        EditorState.readOnly.of(true),  // not working
        lineNumbers(),
        basicSetup
      ],
    });
  };
// ...
const modifiedState = initCoderView(modifiedCode);
const originalState = initCoderView(originalCode);

const editor = new MergeView({
    a: modifiedState,
    b: originalState,
    parent: ref.current,
    highlightChanges: true,
});
//...

But it can be edited and lineNumbers do not displayed

The a and b options to MergeView don’t take a state instance. They take the type of object that you pass to EditorState.create.

Thanks a million, problem solved.