diff --git a/app/javascript/flavours/glitch/components/status_quoted.tsx b/app/javascript/flavours/glitch/components/status_quoted.tsx index a174340457..916d93b726 100644 --- a/app/javascript/flavours/glitch/components/status_quoted.tsx +++ b/app/javascript/flavours/glitch/components/status_quoted.tsx @@ -1,4 +1,5 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import type { ComponentType, ReactNode } from 'react'; import { defineMessage, FormattedMessage, useIntl } from 'react-intl'; @@ -143,6 +144,21 @@ const FilteredQuote: React.FC<{ ); }; +// Adds a wrapper around StatusContainer as the types aren't inheriting correctly with Redux + React 19. +// TODO: Remove this after the Status component is in TS. +interface StatusContainerForQuotesProps { + id?: string | null; + contextType?: string; + isQuotedPost?: boolean; + avatarSize?: number; + headerRenderFn?: StatusHeaderRenderFn; + children?: ReactNode; + [key: string]: unknown; +} + +const StatusContainerWithChildren = + StatusContainer as unknown as ComponentType; + interface QuotedStatusProps { quote: QuoteMap; contextType?: string; @@ -339,7 +355,7 @@ export const QuotedStatus: React.FC = ({ return (
- = ({ nestingLevel={nestingLevel + 1} /> )} - +
); }; @@ -384,17 +400,15 @@ export const StatusQuoteManager = (props: StatusQuoteManagerProps) => { if (quote) { return ( - /* @ts-expect-error Status is not yet typed */ - + - + ); } - /* @ts-expect-error Status is not yet typed */ - return ; + return ; }; diff --git a/app/javascript/flavours/glitch/utils/react_router.tsx b/app/javascript/flavours/glitch/utils/react_router.tsx index 0682fee554..6fe43c81f0 100644 --- a/app/javascript/flavours/glitch/utils/react_router.tsx +++ b/app/javascript/flavours/glitch/utils/react_router.tsx @@ -18,7 +18,7 @@ export const WithOptionalRouterPropTypes = { export interface OptionalRouterProps { ref: unknown; - wrappedComponentRef: unknown; + wrappedComponentRef?: string | ((...args: unknown[]) => unknown) | object; } // This is copied from https://github.com/remix-run/react-router/blob/v5.3.4/packages/react-router/modules/withRouter.js @@ -54,14 +54,6 @@ export function withOptionalRouter< C.displayName = displayName; C.WrappedComponent = Component; - C.propTypes = { - ...Component.propTypes, - wrappedComponentRef: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.func, - PropTypes.object, - ]), - }; return hoistStatics(C, Component); }