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

Forbid to pass any params for routes without them #50

Closed fenok closed 4 months ago

fenok commented 4 months ago

Closes #49

Might be revisited in the future because it breaks a potential use case where we can define an object with params and try to pass it to several routes, some of which might be without params. Ideally, we would want an excess property check here (that forbids every property), but it doesn't seem possible.

For now, the behavior introduced by this PR seems more valuable.