How to only change shape, keep the text

When i call replaceElement api,
i want to keep the text of the original element and change its shape only.

 let elementRegistry = this.modeler.get('elementRegistry');
    let element = elementRegistry.get(id);
    let replace = this.modeler.get('replace');
    let newElementData = {
      type: type
    };

    return replace.replaceElement(element, newElementData);
}

Have you tried using BpmnReplace instead? It takes care of keeping properties that can be kept.