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

my code:

// ...
const initCoderView = (doc: string) => {
    return EditorState.create({
      doc: doc || '',
      extensions: [
        EditorState.readOnly.of(true),  // not working
// ...
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.