accounts-frontend/packages/app/containers/AuthFlowRoute.tsx

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 16:58:52 +05:30
import AuthFlowRouteContents from './AuthFlowRouteContents';
// Make "component" prop required
type Props = Omit<RouteProps, 'component'> & {
component: ComponentType<RouteComponentProps>;
};
2019-12-10 13:17:32 +05:30
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
2020-05-24 04:38:24 +05:30
return (
<Route {...props} render={(routerProps) => <AuthFlowRouteContents component={Component} {...routerProps} />} />
2020-05-24 04:38:24 +05:30
);
};
export default AuthFlowRoute;