18 lines
573 B
TypeScript
Raw Normal View History

import React, { FC, ComponentType } from 'react';
import { Route, RouteProps, RouteComponentProps } from 'react-router-dom';
2019-12-07 13:28:52 +02:00
import AuthFlowRouteContents from './AuthFlowRouteContents';
// Make "component" prop required
type Props = Omit<RouteProps, 'component'> & {
component: ComponentType<RouteComponentProps>;
};
2019-12-10 09:47:32 +02:00
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
2020-05-24 02:08:24 +03:00
return (
<Route {...props} render={(routerProps) => <AuthFlowRouteContents component={Component} {...routerProps} />} />
2020-05-24 02:08:24 +03:00
);
};
export default AuthFlowRoute;