Skip to content

Instantly share code, notes, and snippets.

Notes on migrating from RouterProvider to framework

Official documentation: https://reactrouter.com/upgrading/router-provider

Issues

  1. Vite config. If the vite config contains a root property it needs to be removed. If you are running vitest coverage reports you may want to move it to test.root or it will show coverage for the entire project. Any paths relative to root need to be adjusted as well, e.g. if you have publicDir set to ../public it should be set to just public (or removed as that is the default).

  2. Vitest. You don't want the reactRouter plugin running for tests, so setup as