I have this type:
type RouteList = 'admin/dashboard' | 'admin/users' | 'admin/roles';
How can I create this type above from this array dynamically?
const routeList = ['admin/dashboard','admin/users','admin/roles'];
>Solution :
You can use this code :
const routeList = ['admin/dashboard','admin/users','admin/roles'] as const;
type RouteList = typeof routeList[number]