How to update nodeview from outside

let nodeViews = [];

let editor = new EditorView( this._editor_show_el , {

    state: EditorState.create({
        doc: doc,

    nodeViews: {

        'mainbody'(node, view, getPos) {

            let obj = new MainbodyView(node, view, getPos, {


            return obj;



setTimeout(x => {

  console.log('nodeViews[0]', nodeViews[0]);
  // update it

}, 1000);

At present, I do like this, which can realize my needs, but if it is multi person real-time cooperation, it will not work well

1 Like

Node decorations can be used to pass information to node views (though those are also not the easiest thing to set up). I think there is a need for some imperative way to force node views to redraw, but Iā€™m not sure what it would look like yet.

For you, would a view method that broadcasts a given object to all node views in the document (allowing them to run their own update logic, and possibly opt to be redrawn entirely through a return value) work?

1 Like

Node decorations may not be enough

My requirement is that there is a Mind map component in nodeview, and the interface inside can be updated from the outside when multiple people collaborate in real time.

At present, it is achievable but not elegant

Demo video :