accounts-frontend/packages/app/containers/AuthFlowRoute.tsx
2024-12-10 20:42:06 +01:00

19 lines
563 B
TypeScript

import React, { FC } from 'react';
import { Route, RouteProps } from 'react-router-dom';
import AuthFlowRouteContents from './AuthFlowRouteContents';
// Make "component" prop required
type Props = Omit<RouteProps, 'component'> & Required<Pick<RouteProps, 'component'>>;
const AuthFlowRoute: FC<Props> = ({ component: Component, ...props }) => {
return (
<Route
{...props}
render={(routerProps) => <AuthFlowRouteContents routerProps={routerProps} component={Component} />}
/>
);
};
export default AuthFlowRoute;