Replace nodeViews


#1

Hey, is there a way to replace node views without destroying the whole editor view? setProps isn’t working here as expected.

// create view
const view = new EditorView(element, {
	state,
	nodeViews: {
		test: () => { … }
	},
}

// replace node views later
view.setProps({
	nodeViews: {
		test: () => { … }
	},
}

In this code example I would expect that the destroy function of all registered node views are called and the new node views are constructed.


#2

Oh, that’s a good point. This patch should help with that.


#3

Thanks, this is working fine!