Skip to content

Commit

Permalink
MM-47275 : Migrate 'header_footer_template_route.jsx' to TypeScript (m…
Browse files Browse the repository at this point in the history
…attermost#23791)

* header_footer_template_route.jsx to tsx

* extended Props to RouteProps

* removed Component checks

* changed "ComponentType<RouteComponentProps>" to "ComponentType<any>"

---------

Co-authored-by: Mattermost Build <[email protected]>
  • Loading branch information
notlelouch and mattermost-build authored Jul 6, 2023
1 parent 82b3b67 commit c59c2ea
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import React from 'react';
import {Route} from 'react-router-dom';
import React, {ComponentType} from 'react';
import {Route, RouteProps} from 'react-router-dom';

const HeaderFooterTemplate = React.lazy(() => import('components/header_footer_template'));
const LoggedIn = React.lazy(() => import('components/logged_in'));

export const HFTRoute = ({component: Component, ...rest}) => (
interface Props extends RouteProps {
component: ComponentType<any>;
}

export const HFTRoute = ({component: Component, ...rest}: Props) => (
<Route
{...rest}
render={(props) => (
Expand All @@ -20,7 +24,7 @@ export const HFTRoute = ({component: Component, ...rest}) => (
/>
);

export const LoggedInHFTRoute = ({component: Component, ...rest}) => (
export const LoggedInHFTRoute = ({component: Component, ...rest}: Props) => (
<Route
{...rest}
render={(props) => (
Expand Down

0 comments on commit c59c2ea

Please sign in to comment.