Using Portals seems to be the preferred approach for rendering custom node views in React. This works for the majority of cases, but I’m getting a weird bug where the cursor loses selection when converting from different block types.
Created a reproduction where converting from a heading block to the paragraph node view resets the selection to the start of the paragraph node view: blissful-hamilton-n7gfin - CodeSandbox
The heading is using the toDOM setup from prosemirror-schema-basic. And yes, I can confirm that the node is being recreated, though I’m surprised that the selection is being lost when this happens. Changing the block type on the editor from the Prosemirror homepage retains the selection, for example.
I’m also including an ignoreMutation method that returns false for selection events, to leave Prosemirror in charge of managing the selection.
You probably don’t want to make rendering of nodes with content asynchronous—I can imagine that prevents ProseMirror from maintaining the DOM selection in them.