How to pass shadowroot to codemirror from parent component

I have this code that I think should work (but isn’t):

console.log(document.querySelector(“ion-content”)?.shadowRoot); // this is displaying the shadowRoot in dev console

const view = new EditorView({
  state,
  parent: editorRef.current,
  root: document.querySelector("ion-content")?.shadowRoot,
});

I am getting the component with shadowroot and passing it to the root which according to the docs should accept the shadowRoot I passed. However I still dont see proper styling yet.

My styles look exactly like this previous post with similar issue.

Let me know if this is not the correct way to pass shadowRoot to root property in view.