Replicating a variable present in the component

Do we need to declare the

GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const
{

Function to replicate a variable present in an actor component? We don’t need declare it in Actor classes though.

Yeah, u need it, basically any class if you need to replicate new variable you need that function.