Skip to content

Commit

Permalink
Fix incorrect proptypes from react-router-v5 update (mastodon#27507)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire authored Oct 23, 2023
1 parent 70fd819 commit 0ad6617
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/javascript/mastodon/components/status.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/javascript/mastodon/utils/react_router.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0ad6617

Please sign in to comment.