How to Install TanStack Router

Prerequisites

  • React 18.x.x or 19.x.x

  • ReactDOM 18.x.x or 19.x.x with createRoot support

  • TypeScript 5.3.x or higher (recommended)

Installation Steps

  1. Install the package

    Choose your package manager:

    shell
     npm install @tanstack/react-router
    shell
     pnpm add @tanstack/react-router
    shell
     yarn add @tanstack/react-router
    shell
     bun add @tanstack/react-router
    shell
     deno add npm:@tanstack/react-router
  2. Verify installation

    Check that the package appears in your package.json:

    json
     {
       "dependencies": {
         "@tanstack/react-router": "^x.x.x"
       }
     }