How to create assignable reference to component in c++?

A have AEnemy c++ class. Based on that class I crate BP_Enemy.
Now in PB_Enemy Details panel I want to have field to which I want to assign one of components (component will be create in blueprint).

In other words: in c++ I need reference to component which will be created in future in blueprint. I know that I can create component in c++ by CreateDefaultSubobject<...>(...), but that not the point.

I tried, but non seem to work:

...
protected: // bluprint visible
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ship") int mLife = 100;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ship") TSubclassOf<UActorComponent> ref1 = {};
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ship") TObjectPtr<UActorComponent> ref2;
	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Ship") UActorComponent * ref3;
...

Hi.
It looks to me from your screenshot that it is working. You have a subclass variable and it shows none - nothing assigned. That seems like what you wanted. You choose the class in BP and create the component in BP.
Or am I misinterpreting your question?

C++ can’t directly access Blueprint classes.

This is why the core often made in C++ and from one point on everything becomes BPs.

The only way to do something similar is to create a base C++ class you later extend and override in BP. (C++ will see only the base though)

Ofc the same can be done with interfaces too.

This type of workflow is not typical in Unreal so it’s not supported out of the box.

You would have to write custom Editor UI code to support this sort of thing. I know of one plugin available on github that’s supposed to support this: GitHub - aquanox/BlueprintComponentReferencePlugin: Plugin provides tool for referencing actor components in blueprint editor with a component picker UI · GitHub

I have not used it.
I did not write it.

To Ref 1 I can assign anything that extends UActorComponent. I want assign concrete instance of component from blueprint.

This is exactly what I wanted.
Thanks, I will check this plugin on weekend.