⚠️
The vite-plugin-ssr project has been renamed Vike.
  • If you are already using vite-plugin-ssr then migrate to Vike.
  • For new projects, don't use vite-plugin-ssr but use Vike instead.

Client Routing

By default vite-plugin-ssr does Server Routing. We can opt into Client Routing by setting the clientRouting option to true.

Client(-side) Routing denotes the practice of implementing page navigation on the client-side: when the user navigates to a new page, instead of completely discarding the current page and requesting the HTML of the new page, the current page is preserved and the new page is rendered by manipulating the DOM of the page.

Client Routing enables:

  • Faster page navigation.
  • Client-side state preserved across navigation.
  • Nested Layouts.
  • Custom page transition animations.

We further discuss these use cases at Routing > Server Routing VS Client Routing > Which one to Choose.

See also: