swapComp<A extends Comp<T> > method
Replaces the first top-level component of type A with newC.
No-op if no component of type A exists.
Implementation
E swapComp<A extends Comp<T>>(Comp<T> newC) {
final old = get<A>();
if (old == null) return self;
_removeComponentInstance(old);
addComp(newC);
return self;
}