I am trying to insert a codemirror 6 component inside IonContent, but it completely messes with the codemirror styles because of the shadowdom used by IonContent.
Codemirror allows us to pass a root property where I can pass the IonContent shadow root, but I am not sure how I can get the ref for the parent IonContent.
<IonContent> <CodeMirrorEditor editorRoot={ // pass parent IonContent's shadowRoot ?? }/> </IonContent>
Any ideas how I can deal this this issue? thanks.
EDIT:
I tried using ref and passing it to CodeMirrorEditor like this -
const ICRef = useRef<HTMLIonContentElement>(null); return ( <IonContent ref={ICRef}> <CodeMirrorEditor editorRoot={ ICRef.current.shadowRoot }/> </IonContent> ) `
But I get error -
react-dom.development.js:23275 Uncaught TypeError: Cannot read properties of null (reading ‘shadowRoot’)
1 post - 1 participant