Skip to content

Commit 2f6f100

Browse files
Removed forwardRef from withFullTransactionOrNotFound.tsx
1 parent 299239f commit 2f6f100

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

src/pages/iou/request/step/withFullTransactionOrNotFound.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
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';
44
import type {OnyxEntry} from 'react-native-onyx';
55
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
66
import useOnyx from '@hooks/useOnyx';
@@ -54,11 +54,11 @@ type MoneyRequestRouteName =
5454
type WithFullTransactionOrNotFoundProps<RouteName extends MoneyRequestRouteName> = WithFullTransactionOrNotFoundOnyxProps &
5555
PlatformStackScreenProps<MoneyRequestNavigatorParamList, RouteName>;
5656

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>> {
6060
// 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>) {
6262
const {route} = props;
6363
const transactionID = route.params.transactionID;
6464
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
8787
{...(props as TProps)}
8888
transaction={shouldUseTransactionDraft(userAction, userType) ? transactionDraftData : transaction}
8989
isLoadingTransaction={isLoadingTransaction}
90-
ref={ref}
9190
/>
9291
);
9392
}
9493

9594
WithFullTransactionOrNotFound.displayName = `withFullTransactionOrNotFound(${getComponentDisplayName(WrappedComponent)})`;
9695

97-
return forwardRef(WithFullTransactionOrNotFound);
96+
return WithFullTransactionOrNotFound;
9897
}
9998

10099
export type {WithFullTransactionOrNotFoundProps};

0 commit comments

Comments
 (0)