всем привет.
хочу добавить меню
<Switch>
{
dashboardRoutes.map((route, i) => (
<Routes key={i} {...route} />
))}
<Redirect from="/" to={dashboardRoutes[0].path} />
</Switch>
function Routes(route: RouteInterface) {
return (
<Route
path={route.path}
component={route.component}
render={route.routes} />
);
}
export interface RouteInterface {
path: string,
name: string,
component: React.ComponentType,
routes?: RouteInterface,
}
тс ругается на render, и не уверен в правильном типе для component: React.ComponentType, - подскажите кто знает