Access parent variables and functions through component c++

when u meant make this variable as a class member…
Do you mean this ?

UPROPERTY()
class MySpawnerActor* parentSpawner;

cause the example you gave is exactly like the one i asked which wasn’t working.