Skip to content

Commit 18342ca

Browse files
committed
refactor(types): remove redundant type redeclarations
#15
1 parent 5c34f6e commit 18342ca

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/app/hocs/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ import withRouter from "./with-router";
55
* @hoc Инициализирующая логика приложения
66
* FIXME: Потом какой-нибудь `compose` метод заинсталлим откуда-нить и покрасивше будет
77
*/
8-
export const withHocs = (component: () => JSX.Element) => withRouter(withApollo(component));
8+
export const withHocs = (component: Component) => withRouter(withApollo(component));

src/app/hocs/with-apollo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const client = new ApolloClient({
4040
/**
4141
* @hoc Инициализация подключения apollo для работы с API
4242
*/
43-
const withApollo = (component: () => JSX.Element) => () => (
43+
const withApollo = (component: Component) => () => (
4444
<ApolloProvider client={client}>{component()}</ApolloProvider>
4545
);
4646

src/app/hocs/with-router.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { QueryParamProvider } from "use-query-params";
66
/**
77
* @hoc Инициализация роутера с провайдером для работы с get-параметрами
88
*/
9-
const withRouter = (component: () => JSX.Element) => () => (
9+
const withRouter = (component: Component) => () => (
1010
<BrowserRouter>
1111
<Suspense fallback={<Spin delay={300} className="overlay" size="large" />}>
1212
<QueryParamProvider ReactRouterRoute={Route}>{component()}</QueryParamProvider>

src/react-app-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ declare type Callback = () => void;
1010

1111
declare type Nullable<T> = T | null;
1212

13-
declare type Component<P = any> = (props: P) => JSX.Element;
13+
declare type Component<P = any> = (props?: P) => JSX.Element;

0 commit comments

Comments
 (0)