|
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'; |
3 | 3 | import type {OnyxEntry} from 'react-native-onyx'; |
4 | 4 | import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; |
5 | 5 | import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; |
@@ -57,12 +57,12 @@ type MoneyRequestRouteName = |
57 | 57 |
|
58 | 58 | type WithWritableReportOrNotFoundProps<RouteName extends MoneyRequestRouteName> = WithWritableReportOrNotFoundOnyxProps & PlatformStackScreenProps<MoneyRequestNavigatorParamList, RouteName>; |
59 | 59 |
|
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>, |
62 | 62 | shouldIncludeDeprecatedIOUType = false, |
63 | | -): React.ComponentType<Omit<TProps & RefAttributes<TRef>, keyof WithWritableReportOrNotFoundOnyxProps>> { |
| 63 | +): React.ComponentType<Omit<TProps, keyof WithWritableReportOrNotFoundOnyxProps>> { |
64 | 64 | // 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>) { |
66 | 66 | const {route} = props; |
67 | 67 | const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`, {canBeMissing: true}); |
68 | 68 | const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP, {canBeMissing: true}); |
@@ -96,14 +96,13 @@ export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyR |
96 | 96 | {...(props as TProps)} |
97 | 97 | report={report} |
98 | 98 | reportDraft={reportDraft} |
99 | | - ref={ref} |
100 | 99 | /> |
101 | 100 | ); |
102 | 101 | } |
103 | 102 |
|
104 | 103 | WithWritableReportOrNotFound.displayName = `withWritableReportOrNotFound(${getComponentDisplayName(WrappedComponent)})`; |
105 | 104 |
|
106 | | - return forwardRef(WithWritableReportOrNotFound); |
| 105 | + return WithWritableReportOrNotFound; |
107 | 106 | } |
108 | 107 |
|
109 | 108 | export type {WithWritableReportOrNotFoundProps}; |
0 commit comments