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

19 lines
563 B
TypeScript
Raw Normal View History

import React, { FC } from 'react';
2019-12-07 16:58:52 +05:30
import { Route, RouteProps } from 'react-router-dom';
import AuthFlowRouteContents from './AuthFlowRouteContents';
// Make "component" prop required
type Props = Omit<RouteProps, 'component'> & Required<Pick<RouteProps, 'component'>>;
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}
2020-05-24 04:38:24 +05:30
render={(routerProps) => <AuthFlowRouteContents routerProps={routerProps} component={Component} />}
2019-12-07 16:58:52 +05:30
/>
2020-05-24 04:38:24 +05:30
);
};
export default AuthFlowRoute;