fenok / react-router-typesafe-routes

Comprehensive and extensible type-safe routes for React Router v6 with first-class support for nested routes and param validation.
MIT License
151 stars 3 forks source link

What could go wrong if not using uppercase in route names? #46

Open ddanielcruzz opened 11 months ago

ddanielcruzz commented 11 months ago

Hey, great library!

I saw the in the docs that mention the following:

❗Child routes have to start with an uppercase letter to prevent overlapping with route API.

I was wondering if you could go more in detail of what this means, as I like my routes in lowercase haha.

Thanks!

fenok commented 11 months ago

Hi, thanks!

I wanted to ensure that the future route APIs wouldn't clash with someone's child routes. Using an uppercase letter also clearly indicates that it's a child route.

I've actually come to regret the decision to force child routes to start with an uppercase letter. The next major release will allow basically any naming scheme for child routes because route APIs will be prefixed with a $ (at least it's the current plan). It's like 90% done, I just need to refactor the code a bit and document everything.