4 ms·
ever since react router got merged with remix to become react router v7, I looked around for simpler version, landed on Wouter which is fine.
by 383toast 1y ago
ever since react router got merged with remix to become react router v7, I looked around for simpler version, landed on Wouter which is fine.
- davedx 1y agoI’ve been using Wouter on multiple medium sized projects for 3-4 years now. I’m never going back to react-router if I can avoid it: a hellhole of API churn and self promotion
- petralithic 1y agoTanStack is the sane option here, whether their router or their start product.
- culi 1y agoI'd love to hear more about what motivated the switch. All the additions to react-router are, afaict, opt-in. React-router has 3 "modes"[0] and the declarative mode seems pretty much exactly what the classic library is like with some extra components/features you don't have to use Thought I've enjoyed the code-splitting and access to SPA/SSR/SSG/etc strategies that come with the "framework" mode [0] https://reactrouter.com/start/modes https://reactrouter.com/start/modes
- PebblesHD 1y agoYep, declarative mode is what I use, tried the data mode with loaders and it never really agreed with me as a pattern.
- novoreorx 1y agoI'm using the React Router v7 in framework mode, fetching data directly from the database in server-side components. So far, it works reasonably well as long as we avoid mixing server code with client components. However, although it offers the convenience of writing frontend and backend code together, the mental burden added by this approach makes me feel it is not worth it more and more often.
- nozzlegear 1y agoI've been using wouter in all of my projects for years after being burned by some react router migration bullshit eons ago.
- c-hendricks 1y agoDang, looks like wouter does the same thing as react router v6+ and nested routes don't get all params / paths of the route. ~~Also doesn't have react router v5's route-string typescript parsing.~~ https://github.com/molefrog/wouter?tab=readme-ov-file#route-nesting https://github.com/molefrog/wouter?tab=readme-ov-file#route-...
- nozzlegear 1y ago> Also doesn't have react router v5's route-string typescript parsing. It does, assuming you're talking about automatically parsing "/foo/:id" and getting a typed "{ id: string? }" route params object out of it? Wouter does that when using typescript.
- c-hendricks 1y agoThanks for the correction, after looking at the types I'm guessing it's this bit: https://github.com/molefrog/wouter/blob/v3/packages/wouter/types/index.d.ts#L35-L39 https://github.com/molefrog/wouter/blob/v3/packages/wouter/t...
- nozzlegear 1y agoYep! That's the type. It used to be a lot more complicated if I remember correctly, but looks like the author is importing a type from that "regexparam" package to do it now.
- iamsaitam 1y agowouter is great until you need hash routing and then it's shite.