Я попробовал и протестировал нижеприведенное, надеюсь, это должно работать.
// select element to unwrap
var el = document.getElementsByTagName("CustomComponent");
// get the element's parent node, if it returns array then take the first index
var parent = el[0].parentNode;
// move all children out of the element
while (el[0].firstChild) {
parent.insertBefore(el[0].firstChild, el[0]);
}
// remove the empty element
parent.removeChild(el[0]);
Счастливого кодирования!