Using pure C++ UUserWidget inside of another BP widget in UMG editor

How to create UUserWidget and populate it with widgets in C++?
For example, create UUserWidget, then create and add Text Box to it

I’ve tried to WidgetTree->CosntructWidget and assigning it to WidgetTree->RootWidget inside NativeOnInitialized/NativeConstruct/NativePreConstruct, like so:

// .h
UCLASS()
class PURECPPWIDGET_API UMyUserWidget : public UUserWidget
{
	GENERATED_BODY()

public:
	UCanvasPanel* CanvasPanel;

private:
	void NativeOnInitialized() override;
	void NativeConstruct() override;
	void NativePreConstruct() override;

	void CreateWidgets();
};

// .cpp
void UMyUserWidget::NativeOnInitialized()
{
	UE_LOG(LogTemp, Warning, TEXT("UMyUserWidget::NativeOnInitialized before"));
	Super::NativeOnInitialized();

	CreateWidgets();
}

void UMyUserWidget::NativeConstruct()
{
	UE_LOG(LogTemp, Warning, TEXT("UMyUserWidget::NativeCosntruct"));
	Super::NativeConstruct();
}

void UMyUserWidget::NativePreConstruct()
{
	UE_LOG(LogTemp, Warning, TEXT("UMyUserWidget::NativePreConstruct"));
	Super::NativePreConstruct();
}

void UMyUserWidget::CreateWidgets()
{
	UE_LOG(LogTemp, Warning, TEXT("UMyUserWidget::CreateWidgets before"));

	CanvasPanel = WidgetTree->ConstructWidget<UCanvasPanel>(UCanvasPanel::StaticClass());
	if (!CanvasPanel)
		return;

	auto textBlock = WidgetTree->ConstructWidget<UTextBlock>(UTextBlock::StaticClass());
	textBlock->SetText(FText::FromString("Hello World!"));
	CanvasPanel->AddChildToCanvas(textBlock);

        // WidgetTree->RootWidget = textBlock;
	WidgetTree->RootWidget = CanvasPanel;

	UE_LOG(LogTemp, Warning, TEXT("UMyUserWidget::CreateWidgets after"));
}

But when I add My User Widget in UMG editor, nothing is visible