From a48050dacba2fe1135d67c276badb67b5d48481f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arkadiusz=20Chrab=C4=85szczewski?= Date: Tue, 13 Feb 2024 10:25:16 +0100 Subject: [PATCH] fix: ts params issue --- .../workspace/categories/WorkspaceCategoriesPage.tsx | 8 +++----- .../workspace/categories/withPolicyAccessOrNotFound.tsx | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx index ab175ba860a5..832c07c90431 100644 --- a/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx +++ b/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx @@ -14,7 +14,6 @@ import useLocalize from '@hooks/useLocalize'; import useTheme from '@hooks/useTheme'; import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; -import compose from '@libs/compose'; import type {CentralPaneNavigatorParamList} from '@navigation/types'; import ONYXKEYS from '@src/ONYXKEYS'; import type SCREENS from '@src/SCREENS'; @@ -109,11 +108,10 @@ function WorkspaceCategoriesPage({policyCategories}: WorkspaceCategoriesPageProp WorkspaceCategoriesPage.displayName = 'WorkspaceCategoriesPage'; -export default compose( - withPolicyAccessOrNotFound(), +export default withPolicyAccessOrNotFound()( withOnyx({ policyCategories: { key: ({route}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${route.params.policyID}`, }, - }), -)(WorkspaceCategoriesPage); + })(WorkspaceCategoriesPage), +); diff --git a/src/pages/workspace/categories/withPolicyAccessOrNotFound.tsx b/src/pages/workspace/categories/withPolicyAccessOrNotFound.tsx index 642dce2ebd20..12ffdce22937 100644 --- a/src/pages/workspace/categories/withPolicyAccessOrNotFound.tsx +++ b/src/pages/workspace/categories/withPolicyAccessOrNotFound.tsx @@ -1,5 +1,4 @@ /* eslint-disable rulesdir/no-negated-variables */ -import type {RouteProp} from '@react-navigation/native'; import React, {useEffect} from 'react'; import type {ForwardedRef, RefAttributes} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; @@ -23,7 +22,7 @@ type WithWorkspaceAccessOnyxProps = { type WithWorkspaceAccessProps = WithWorkspaceAccessOnyxProps & { /** The report currently being looked at */ - route: RouteProp<{params: {policyID: string}}>; + route: {params: {policyID: string}}; /** The report currently being looked at */ policy: OnyxTypes.Policy;