Skip to content

Commit d88edc6

Browse files
Removed forwardRef from withWritableReportOrNotFound.tsx
1 parent 2f6f100 commit d88edc6

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type {ComponentType, ForwardedRef, RefAttributes} from 'react';
2-
import React, {forwardRef, useEffect} from 'react';
1+
import type {ComponentType} from 'react';
2+
import React, {useEffect} from 'react';
33
import type {OnyxEntry} from 'react-native-onyx';
44
import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView';
55
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
@@ -57,12 +57,12 @@ type MoneyRequestRouteName =
5757

5858
type WithWritableReportOrNotFoundProps<RouteName extends MoneyRequestRouteName> = WithWritableReportOrNotFoundOnyxProps & PlatformStackScreenProps<MoneyRequestNavigatorParamList, RouteName>;
5959

60-
export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyRequestRouteName>, TRef>(
61-
WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>,
60+
export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyRequestRouteName>>(
61+
WrappedComponent: ComponentType<TProps>,
6262
shouldIncludeDeprecatedIOUType = false,
63-
): React.ComponentType<Omit<TProps & RefAttributes<TRef>, keyof WithWritableReportOrNotFoundOnyxProps>> {
63+
): React.ComponentType<Omit<TProps, keyof WithWritableReportOrNotFoundOnyxProps>> {
6464
// eslint-disable-next-line rulesdir/no-negated-variables
65-
function WithWritableReportOrNotFound(props: Omit<TProps, keyof WithWritableReportOrNotFoundOnyxProps>, ref: ForwardedRef<TRef>) {
65+
function WithWritableReportOrNotFound(props: Omit<TProps, keyof WithWritableReportOrNotFoundOnyxProps>) {
6666
const {route} = props;
6767
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`, {canBeMissing: true});
6868
const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: true});
@@ -96,14 +96,13 @@ export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyR
9696
{...(props as TProps)}
9797
report={report}
9898
reportDraft={reportDraft}
99-
ref={ref}
10099
/>
101100
);
102101
}
103102

104103
WithWritableReportOrNotFound.displayName = `withWritableReportOrNotFound(${getComponentDisplayName(WrappedComponent)})`;
105104

106-
return forwardRef(WithWritableReportOrNotFound);
105+
return WithWritableReportOrNotFound;
107106
}
108107

109108
export type {WithWritableReportOrNotFoundProps};

0 commit comments

Comments
 (0)