How to insert a html string in to state


I have a created state, I want to insert a dom into it and the cursor position is at the end of the dom string, here is my code.

private combineEditorView = (prevNode: IProjectNode) => {
    if(!this.editorView) return
    const preState = createEditorState(prevNode.content)
    const tr =, true)

It works, but the node in the state become two paragraphs (I except one), is there any better methods?