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
145 stars 3 forks source link

Consider separating parsing and validation #14

Closed fenok closed 1 year ago

fenok commented 2 years ago

As of now, parsing and validation are both done via getTyped method. This leads to the following drawbacks:

We could split getTyped into required getTyped and optional validate, but it might be inconvenient for creating custom types.

Overall, it's not clear which approach is best.

fenok commented 1 year ago

Closing because fallbacks validity is now checked, which was the main concern.

The second use case is pretty obscure and a variant of it can be implemented in the userland similarly to how fallbacks are checked.