|
1 | 1 | import {useIsFocused} from '@react-navigation/native'; |
2 | | -import type {ComponentType, ForwardedRef, RefAttributes} from 'react'; |
3 | | -import React, {forwardRef} from 'react'; |
| 2 | +import type {ComponentType} from 'react'; |
| 3 | +import React from 'react'; |
4 | 4 | import type {OnyxEntry} from 'react-native-onyx'; |
5 | 5 | import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; |
6 | 6 | import useOnyx from '@hooks/useOnyx'; |
@@ -54,11 +54,11 @@ type MoneyRequestRouteName = |
54 | 54 | type WithFullTransactionOrNotFoundProps<RouteName extends MoneyRequestRouteName> = WithFullTransactionOrNotFoundOnyxProps & |
55 | 55 | PlatformStackScreenProps<MoneyRequestNavigatorParamList, RouteName>; |
56 | 56 |
|
57 | | -export default function <TProps extends WithFullTransactionOrNotFoundProps<MoneyRequestRouteName>, TRef>( |
58 | | - WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>, |
59 | | -): React.ComponentType<Omit<TProps, keyof WithFullTransactionOrNotFoundOnyxProps> & RefAttributes<TRef>> { |
| 57 | +export default function <TProps extends WithFullTransactionOrNotFoundProps<MoneyRequestRouteName>>( |
| 58 | + WrappedComponent: ComponentType<TProps>, |
| 59 | +): React.ComponentType<Omit<TProps, keyof WithFullTransactionOrNotFoundOnyxProps>> { |
60 | 60 | // eslint-disable-next-line rulesdir/no-negated-variables |
61 | | - function WithFullTransactionOrNotFound(props: Omit<TProps, keyof WithFullTransactionOrNotFoundOnyxProps>, ref: ForwardedRef<TRef>) { |
| 61 | + function WithFullTransactionOrNotFound(props: Omit<TProps, keyof WithFullTransactionOrNotFoundOnyxProps>) { |
62 | 62 | const {route} = props; |
63 | 63 | const transactionID = route.params.transactionID; |
64 | 64 | const userAction = 'action' in route.params && route.params.action ? route.params.action : CONST.IOU.ACTION.CREATE; |
@@ -87,14 +87,13 @@ export default function <TProps extends WithFullTransactionOrNotFoundProps<Money |
87 | 87 | {...(props as TProps)} |
88 | 88 | transaction={shouldUseTransactionDraft(userAction, userType) ? transactionDraftData : transaction} |
89 | 89 | isLoadingTransaction={isLoadingTransaction} |
90 | | - ref={ref} |
91 | 90 | /> |
92 | 91 | ); |
93 | 92 | } |
94 | 93 |
|
95 | 94 | WithFullTransactionOrNotFound.displayName = `withFullTransactionOrNotFound(${getComponentDisplayName(WrappedComponent)})`; |
96 | 95 |
|
97 | | - return forwardRef(WithFullTransactionOrNotFound); |
| 96 | + return WithFullTransactionOrNotFound; |
98 | 97 | } |
99 | 98 |
|
100 | 99 | export type {WithFullTransactionOrNotFoundProps}; |
0 commit comments