Skip to content

Commit

Permalink
fix: ts params issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ArekChr committed Feb 14, 2024
1 parent 20f9082 commit a48050d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -109,11 +108,10 @@ function WorkspaceCategoriesPage({policyCategories}: WorkspaceCategoriesPageProp

WorkspaceCategoriesPage.displayName = 'WorkspaceCategoriesPage';

export default compose(
withPolicyAccessOrNotFound(),
export default withPolicyAccessOrNotFound()(
withOnyx<WorkspaceCategoriesPageProps, WorkspaceCategoriesOnyxProps>({
policyCategories: {
key: ({route}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${route.params.policyID}`,
},
}),
)(WorkspaceCategoriesPage);
})(WorkspaceCategoriesPage),
);
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;
Expand Down

0 comments on commit a48050d

Please sign in to comment.