Proper way to change an actor's root in the editor?

Hi everyone!

What would be the proper way to change an actor’s root in the editor by changing a property?

I am trying to have an actor that has a UStaticMesh as it’s root component and then, by changing a boolean and using PostEditChangeProperty I want to replace the UStaticMesh with a UDestructibleComponent.

It kind of works, the problem is that when I compile a child blueprint the added components get erased. Meaning that I can make changes to the instances, but not to the actual Blueprints.