PromucFlow_constructor/app/client/src/pages/common/ProtectedRoute.tsx

16 lines
321 B
TypeScript
Raw Normal View History

import * as React from "react";
2019-12-16 08:49:10 +00:00
import { Route } from "react-router-dom";
2019-09-02 15:36:24 +00:00
const ProtectedRoute = ({
component: Component,
...rest
}: {
path: string;
component: React.ReactType;
exact?: boolean;
}) => {
2019-12-16 08:49:10 +00:00
return <Route {...rest} render={props => <Component {...props} />} />;
};
2019-09-02 14:50:01 +00:00
export default ProtectedRoute;