mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-12-02 11:41:04 +05:30
25 lines
545 B
TypeScript
25 lines
545 B
TypeScript
import React from 'react';
|
|
import { Route, RouteProps } from 'react-router-dom';
|
|
|
|
import AuthFlowRouteContents from './AuthFlowRouteContents';
|
|
|
|
export default function AuthFlowRoute(props: RouteProps) {
|
|
const { component: Component, ...routeProps } = props;
|
|
|
|
if (!Component) {
|
|
throw new Error('props.component required');
|
|
}
|
|
|
|
return (
|
|
<Route
|
|
{...routeProps}
|
|
render={(routerProps) => (
|
|
<AuthFlowRouteContents
|
|
routerProps={routerProps}
|
|
component={Component}
|
|
/>
|
|
)}
|
|
/>
|
|
);
|
|
}
|