3 ms·
Dang, 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
by c-hendricks 1y ago
Dang, 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.