TanStackRouter

现代且可扩展的 React 和 Solid 应用程序路由

一个完全类型安全的路由器,内置数据获取、过时后重新验证缓存以及一流的搜索参数 API。

开始使用

类型安全且强大,但简单易用

TanStack Router 构建在其他工具流行的现代路由模式基础上,但从头开始重新设计,以实现 100% 类型安全,且不影响开发体验。您可以鱼与熊掌兼得!

内置数据获取与缓存功能

通过 TanStack Router 的 loader API 提升数据获取并避免瀑布流,获得 内置缓存和自动预加载带来的即时导航体验。需要更加定制化的功能?Router 的 API 设计可与您喜欢的客户端缓存库协同工作!

让状态管理工具羡慕的搜索参数 API

TanStack Router 不会让您直接面对 URLSearchParam 困境,而是提供了状态管理级别的搜索参数 API。通过 架构、验证、完全类型安全和前/后处理,您可以在 URL 中管理状态,并轻松将其同步到您选择的状态管理工具。

合作伙伴

Clerk
Clerk and TanStack are partnering to elevate your application's security and user experience with industry-leading authentication and user management. Paired with TanStack's no-nonsense routing and tooling, you'll be equipped to effortlessly deliver top-notch experiences that your users can trust and your developers can rely on.
Learn More
Convex
Official Deployment Partner
Netlify and TanStack have joined forces to provide developers with world-class deployment and hosting capabilities for modern web applications. Together we're focused on delivering an exceptional developer experience through seamless deployment workflows, edge functions, and serverless capabilities that help teams build and ship faster. Our partnership ensures TanStack applications can take full advantage of Netlify's powerful platform features.
Learn More
Neon
Neon and TanStack are joining forces to bring serverless PostgreSQL to the modern web stack. With Neon's blazing-fast branching, autoscaling, and storage/compute separation, developers can instantly spin up production-grade databases for every branch, test, or feature. TanStack's developer-first framework + Neon's cutting-edge infra = next-gen DX.
Learn More
Convex
Convex has teamed up with TanStack to not only deliver a first-class end-to-end type-safe database experience to TanStack developers, but to also ensure TanStack is ready for the real-time database arena. Convex's all-in-one platform delivers end-to-end type-safety via a revolutionary relational, real-time database and together, we're elevating what's possible with real-time React applications.
Learn More
Sentry
Sentry and TanStack are on a mission to make sure your apps are error-free and high-performers. Sentry's best-in-class error monitoring and performance insights combined with TanStack's cutting-edge libraries ensure that you can deliver the best possible experience to your users. Together, we're committed to making sure that you can build with confidence.
Learn More

功能丰富且轻量级

看看这必不可少的功能列表:

100% 类型安全 并行路由加载器 一流的搜索参数 API 嵌套/布局路由 轻量级 (12kb) Suspense + 过渡 严格导航 路径自动补全 搜索参数架构 搜索参数验证 搜索参数解析 + 序列化 搜索参数预/后处理 结构共享 自动预获取 异步元素 等待元素 错误边界
开源项目上的广告? 这是回到了1999年吗?
请理解... TanStack 是100%私有运营的,没有付费产品、风险投资或收购计划。我们是一个小团队,致力于开发每天被数百万人使用的软件。您期望我们怎么做呢?
了解我们的理念 来了解更多关于我们如何长期坚持(并保持相关性)的计划。

亲自试用一下!

创建一个路由,加入路由器,然后开始编写代码!

哇,你已经走了这么远!
只剩下一件事要做了...
开始使用!