How are you supposed to change the doc-content? Probably a simple question but I didn´t quiet get, how you work using view.dispatch or view.setState…
I tried this
const state = EditorState.create({
...editorRef.state,
doc: 'my new editorcontent'
});
editorRef.setState(state);
which ended up in changing nothing except that it even deleted all my extensions…
I also tried using
view.dispatch({
newDoc: toText("my new content")
})
But that also didn´t work out (couldn´t even access the toText function because I couldn´t find out what it is derived from).
So what did I do wrong here?
Thanks in advance!