I have code that dynamically spawns an actor into the current EDITOR world, and adds components to it. This all works correctly. However if you save the level then reload it, all the spawned actors are there, but the components are gone
UWorld* world = GEditor->GetEditorWorldContext().World();
AActor* newActor = world->SpawnActor<AActor>(position, rotation);
UHierarchicalInstancedStaticMeshComponent* hism = newObject<UHierarchicalInstancedStaticMeshComponent>(newActor, UHierarchicalInstancedStaticMeshComponent::StaticClass(), *assetName);
hism->RegisterComponent();
hism->AttachTo(newActor->GetRootComponent(), NAME_None, EAttachLocation::SnapToTarget, true);