when defining custom nodeViews with its own dom property, I assumed I can strip away the toDOM() in the schema. But then things like dragging seem to be broken (and the official nodeViews example also has it not stripped out).
So the schema toDOM() function needs to be kept, to allow a node to be serialized for special purpose such as drag and drop ?
Yes, a node view is used when the node is displayed inside the editor, but you’ll still need some way to turn the node into semantic HTML for copy/paste and drag/drop (and possibly also export/import, if you use HTML for that) reasons.
I also have a doubt regarding the point mentioned in this thread.
Let’s say I have custom a nodeView defined for paragraph node to process and assign some special attributes to the DOM, which otherwise would be hard to set with simple toDOM() method.
But based on reply from @marijn, if we need to keep both for drag/drop and copy/paste to function, then how should we manage the differences of logic between toDOM and nodeView, as the paragraph displayed in the editor may turn out to be different based on which one is method gets executed.