Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

comparison.md

76 lines9.8 KB

1---
2id: comparison
3title: Comparison | React Location vs React Router
4toc: false
5---
6​
7Before you commit to a new tool, it's always nice to know how it stacks up against the competition!
8​
9> 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.
10​
11Feature/Capability Key:
12​
13- βœ… 1st-class, built-in, and ready to use with no added configuration or code
14- 🟒 Full Support as an official plugin or addon package
15- 🟑 Partial Support
16- πŸ”Ά Possible, but requires custom code/implementation
17- πŸ›‘ Not officially supported
18​
19| | React Location | React Router DOM [_(Website)_][react-router] |
20| ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------- |
21| Github Repo / Stars | [![][stars-react-location]][gh-react-location] | [![][stars-react-router]][gh-react-router] |
22| Their Comparison | | (none) |
23| Bundle Size | [![][bp-react-location]][bpl-react-location] (react-location) | [![][bp-react-router]][bpl-react-router] (react-router-dom) |
24| | - | [![][bp-history]][bpl-history] (history) |
25| **General** | | |
26| Nested / Layout Routes | βœ… | βœ… |
27| Path Params | βœ… | βœ… |
28| JSX Routes | 🟒 `react-location-elements-to-routes` | βœ… |
29| Code-Splitting | βœ… | βœ… |
30| Ranked Routes | 🟒 `react-location-ranked-routes` | βœ… |
31| Active Link Customization | βœ… | βœ… |
32| SSR | πŸ›‘ | βœ… |
33| Route Mount/Transition/Unmount Events | βœ… | πŸ›‘ |
34| Official Devtools | 🟒 `react-location-devtools` | πŸ›‘ |
35| **Search Params** | | |
36| Basic Search Params | βœ… | βœ… |
37| Search Param Hooks | βœ… | βœ… |
38| Integrated `<Link/>` search param API | βœ… | 🟑 (search-string only via the `to` prop) |
39| Integrated `useNavigate` search param API | βœ… | 🟑 (search-string only via the `search` property) |
40| JSON Search Params | βœ… | πŸ”Ά |
41| Search Param Stabilization ([Structural Sharing](https://en.wikipedia.org/wiki/Persistent_data_structure)) | βœ… | πŸ”Ά |
42| Custom Search Param parsing/serialization | βœ… | πŸ”Ά |
43| Queued/Batched Search Param Updates | βœ… | πŸ›‘ |
44| Search-Based Route Matching | βœ… | 🟑 (string/Regex only?) |
45| Search Param Compression | 🟒 `react-location-jsurl` | πŸ”Ά |
46| **Async Routing, Loaders & Data** | | |
47| Route Loaders & Data (parallelized and blocking) | βœ… | πŸ›‘ |
48| Basic Route Data Caching | βœ… | πŸ›‘ |
49| Route Loader Prefetching | βœ… | πŸ›‘ |
50| External Caching Interface | βœ… | πŸ›‘ |
51| Route Error Elements | βœ… | πŸ›‘ |
52| Route Pending Elements | βœ… | πŸ›‘ |
53| Pending Timing (delay, min-show) | βœ… | πŸ›‘ |
54​
55<!-- ### Notes
56​
57> **<sup>1</sup> stuff** -->
58​
59<!-- -->
60​
61[bp-react-location]: https://badgen.net/bundlephobia/minzip/react-location?label=πŸ’Ύ
62[bpl-react-location]: https://bundlephobia.com/result?p=react-location
63[gh-react-location]: https://github.com/tanstack/react-location
64[stars-react-location]: https://img.shields.io/github/stars/tanstack/react-location?label=%F0%9F%8C%9F
65​
66<!-- -->
67​
68[react-router]: https://github.com/remix-run/react-router
69[bp-react-router]: https://badgen.net/bundlephobia/minzip/react-router-dom?label=πŸ’Ύ
70[bp-history]: https://badgen.net/bundlephobia/minzip/history?label=πŸ’Ύ
71[gh-react-router]: https://github.com/remix-run/react-router
72[stars-react-router]: https://img.shields.io/github/stars/remix-run/react-router?label=%F0%9F%8C%9F
73[bpl-react-router]: https://bundlephobia.com/result?p=react-router-dom
74[bpl-history]: https://bundlephobia.com/result?p=history
75​
76<!-- -->