Object.keys(envRoutes).
find((k) => k.split('|').includes(process.env.NODE_ENV)) ||
Object.keys(envRoutes)[0]
];
Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ 'development|beta': { path: string; element: Element; }[]; production: { path: string; element: Element; }[]; }'.
No index signature with a parameter of type 'string' was found on type '{ 'development|beta': { path: string; element: Element; }[]; production: { path: string; element: Element; }[]; }'
а вот envRoutes
const envRoutes = {
'development|beta': [
{
path: '/:client',
element: <></>
},
{
path: '/:client',
element: <Shop />
}
],
'production': [
{
path: '/',
element: <Shop />
}
],
};
дошло const envRoutes: Record<string, RouteObject[]> = {
Обсуждают сегодня