Skip to content

Commit

Permalink
fix: update TypeScript typings in HOC for better compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinaybathina committed Sep 19, 2024
1 parent 90968b8 commit 76343cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/iou/request/step/withWritableReportOrNotFound.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ type WithWritableReportOrNotFoundProps<T extends MoneyRequestRouteName> = WithWr
export default function <TProps extends WithWritableReportOrNotFoundProps<MoneyRequestRouteName>, TRef>(
WrappedComponent: ComponentType<TProps & RefAttributes<TRef>>,
shouldIncludeDeprecatedIOUType = false,
): React.ComponentType<Omit<TProps, keyof WithWritableReportOrNotFoundProps<MoneyRequestRouteName>> & RefAttributes<TRef>> {
): React.ComponentType<Omit<TProps & RefAttributes<TRef>, keyof WithWritableReportOrNotFoundOnyxProps>> {
// eslint-disable-next-line rulesdir/no-negated-variables
function WithWritableReportOrNotFound(props: Omit<TProps, keyof WithWritableReportOrNotFoundProps<MoneyRequestRouteName>>, ref: ForwardedRef<TRef>) {
const {route} = props as TProps;
function WithWritableReportOrNotFound(props: Omit<TProps, keyof WithWritableReportOrNotFoundOnyxProps>, ref: ForwardedRef<TRef>) {
const {route} = props;
const iouTypeParamIsInvalid = !Object.values(CONST.IOU.TYPE)
.filter((type) => shouldIncludeDeprecatedIOUType || (type !== CONST.IOU.TYPE.REQUEST && type !== CONST.IOU.TYPE.SEND))
.includes(route.params?.iouType);
Expand Down

0 comments on commit 76343cb

Please sign in to comment.