From 0ad66175bf59a34b03d9ab2347181548d07089ea Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 23 Oct 2023 11:39:53 +0200 Subject: [PATCH] Fix incorrect proptypes from react-router-v5 update (#27507) --- app/javascript/mastodon/components/status.jsx | 4 ++-- app/javascript/mastodon/utils/react_router.jsx | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/javascript/mastodon/components/status.jsx b/app/javascript/mastodon/components/status.jsx index a378868020..e10c31b02d 100644 --- a/app/javascript/mastodon/components/status.jsx +++ b/app/javascript/mastodon/components/status.jsx @@ -11,7 +11,7 @@ import { HotKeys } from 'react-hotkeys'; import { Icon } from 'mastodon/components/icon'; import PictureInPicturePlaceholder from 'mastodon/components/picture_in_picture_placeholder'; -import { withOptionalRouter, WithRouterPropTypes } from 'mastodon/utils/react_router'; +import { withOptionalRouter, WithOptionalRouterPropTypes } from 'mastodon/utils/react_router'; import Card from '../features/status/components/card'; // We use the component (and not the container) since we do not want @@ -113,7 +113,7 @@ class Status extends ImmutablePureComponent { inUse: PropTypes.bool, available: PropTypes.bool, }), - ...WithRouterPropTypes, + ...WithOptionalRouterPropTypes, }; // Avoid checking props that are functions (and whose equality will always diff --git a/app/javascript/mastodon/utils/react_router.jsx b/app/javascript/mastodon/utils/react_router.jsx index a56883270b..fa8f0db2b5 100644 --- a/app/javascript/mastodon/utils/react_router.jsx +++ b/app/javascript/mastodon/utils/react_router.jsx @@ -49,6 +49,7 @@ export function withOptionalRouter(Component) { C.displayName = displayName; C.WrappedComponent = Component; C.propTypes = { + ...Component.propTypes, wrappedComponentRef: PropTypes.oneOfType([ PropTypes.string, PropTypes.func,