0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00
router/docs/framework/react/comparison.md
Sean Cassiere b2004cbbdc
docs: fixing some inconsistencies in the guides (#1229)
* fix: `routeTree` into the `createRouter` instance

* fix: switch to `Block/useBlocker` since react-router uses `useBlocker` instead of `Prompt/usePrompt`

* fix: rename RouteApi to getRouteApi and include useLoaderDeps

* feat: indicate `.lazy` suffix and mark deprecation suffixes being phased out

* fix: createRootRouteWithContext - `routeTree` into the `createRouter` instance

* fix: rootRouteWithContext - `routeTree` into the `createRouter` instance

* feat: `Function` keyword is redundant since its already nested under `Functions`

* feat: alphabetical sorting of functions

* feat: move `rootRouteWithContext` to the deprecated list

* feat: use backticks

* feat: alphabetical sorting of hooks
2024-02-27 11:55:10 -07:00

12 KiB

title toc
Comparison | TanStack Router vs React Router false

Before you commit to a new tool, it's always nice to know how it stacks up against the competition!

This comparison table strives to be as accurate and as unbiased as possible. If you use any of these libraries and feel the information could be improved, feel free to suggest changes (with notes or evidence of claims) using the "Edit this page on GitHub" link at the bottom of this page.

Feature/Capability Key:

  • ✅ 1st-class, built-in, and ready to use with no added configuration or code
  • 🔵 Supported via addon package
  • 🟡 Partial Support
  • 🔶 Possible, but requires custom code/implementation/casting
  • 🛑 Not officially supported
TanStack Router React Router DOM (Website) Next.JS (Website)
Github Repo / Stars
Bundle Size ❓
History, Memory & Hash Routers ✅ ✅ 🛑
Nested / Layout Routes ✅ ✅ ✅
Suspense-like Route Transitions ✅ ✅ ✅
Typesafe Routes ✅ 🛑 🟡
Code-based Routes ✅ ✅ 🛑
File-based Routes ✅ ✅ ✅
Router Loaders ✅ ✅ ✅
SWR Loader Caching ✅ 🛑 ✅
Route Prefetching ✅ ✅ ✅
Auto Route Prefetching ✅ 🔵 (via Remix) ✅
Route Prefetching Delay ✅ 🔶 🛑
Path Params ✅ ✅ ✅
Typesafe Path Params ✅ 🛑 🛑
Path Param Validation ✅ 🛑 🛑
Custom Path Param Parsing/Serialization ✅ 🛑 🛑
Ranked Routes ✅ ✅ ✅
Active Link Customization ✅ ✅ ✅
Optimistic UI ✅ ✅ 🔶
Typesafe Absolute + Relative Navigation ✅ 🛑 🛑
Route Mount/Transition/Unmount Events ✅ 🛑 🛑
Devtools ✅ 🛑 🛑
Basic Search Params ✅ ✅ ✅
Search Param Hooks ✅ ✅ ✅
<Link/>/useNavigate Search Param API ✅ 🟡 (search-string only via the to/search options) 🟡 (search-string only via the to/search options)
JSON Search Params ✅ 🔶 🔶
TypeSafe Search Params ✅ 🛑 🛑
Search Param Schema Validation ✅ 🛑 🛑
Search Param Immutability + Structural Sharing ✅ 🔶 🛑
Custom Search Param parsing/serialization ✅ 🔶 🛑
Search Param Middleware ✅ 🛑 🛑
Suspense Route Elements ✅ ✅ ✅
Route Error Elements ✅ ✅ ✅
Route Pending Elements ✅ ✅ ✅
<Block>/useBlocker ✅ 🔶 ❓
SSR ✅ ✅ ✅
Streaming SSR ✅ ✅ ✅
Deferred Primitives ✅ ✅ ✅
Navigation Scroll Restoration ✅ ✅ ❓
Loader Caching (SWR + Invalidation) 🔶 (TanStack Query is recommended) 🛑 ✅
Actions 🔶 (TanStack Query is recommended) ✅ ✅
<Form> API 🛑 ✅ ✅
Full-Stack APIs 🛑 ✅ ✅