I am using setContent, but it replaces everything within the editor. I only want to update the content in a particular location within the editor. Currently I have it hooking into the editor with an onChange event that runs the setContent command, and pass in state variables. This works but the problem is that once I introduce a new variable to update, I have to pass in all of the elements over again, and manage them that way. So my command looks like
function onChangeText(e){
editor?.commands.setContent(
`
<h1>${SOMETEXT}</h1>
<Custom Elment>${e.target.value}</Custom Element>
`
}
<h1>SOME TEXT</h1>
<Custom Element> UPDATE THIS TEXT ONLY </Custom Element>