If during an animating view transition you replace the root element, then the originating element of the pseudo-element tree is disconnected, so you can't reasonably do stuff like computing styles ...
A vanilla JS implementation of a single page router <view-route> and declarative view transitions using a <view-transition> custom element. Both can be used ...