Single Source of Truth
Single Source of Truth
π¨βπΌ We want a single source of truth for route names and paths without enums.
Using
as const lets us derive types directly from the runtime object.π¨ Open
and:
- Add
as constto theroutesobject - Create
RouteNameandRoutePathtypes from the object - Fix the
defaultRouteassignment - Implement
getRoutePathto return the route path for a given name
π°
keyof typeof gives you the keys; indexed access gives you the values.

