Open History to see the last commit
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<!-- -->