YouTube is not really a SPA as in React or Vue. It looks like they use something similar to TurboLinks or Intercooler: https://youtube.github.io/spfjs/
Edit for downvoters: Ok, technically, YouTube is a SPA. What I meant, in the context of this discussion, is that YouTube uses a technique similar to what GitHub does, where the server returns fragments of HTML.