框架
版本

如何安装 TanStack Router

先决条件

  • React 18.x.x 或 19.x.x
  • ReactDOM 18.x.x 或 19.x.x,支持 createRoot
  • TypeScript 5.3.x 或更高版本(推荐)

安装步骤

  1. 安装包

    选择你的包管理器

    sh
    npm install @tanstack/react-router
    
    npm install @tanstack/react-router
    
    sh
    pnpm add @tanstack/react-router
    
    pnpm add @tanstack/react-router
    
    sh
    yarn add @tanstack/react-router
    
    yarn add @tanstack/react-router
    
    sh
    bun add @tanstack/react-router
    
    bun add @tanstack/react-router
    
    sh
    deno add npm:@tanstack/react-router
    
    deno add npm:@tanstack/react-router
    
  2. 验证安装

    检查包是否出现在你的 package.json

    json
    {
      "dependencies": {
        "@tanstack/react-router": "^x.x.x"
      }
    }
    
    {
      "dependencies": {
        "@tanstack/react-router": "^x.x.x"
      }
    }
    
我们的合作伙伴
Code Rabbit
Netlify
Neon
Clerk
Convex
Sentry
订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。

订阅 Bytes

您的每周 JavaScript 资讯。每周一免费发送给超过 10 万开发者。

Bytes

无垃圾邮件。您可以随时取消订阅。