From 152b10b6246987bfb2cc73ecd2a20578d05b62dc Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 23 Aug 2023 15:43:41 +0200 Subject: [PATCH] Fix some React warnings (#26609) --- app/javascript/mastodon/features/explore/results.jsx | 8 ++++---- app/javascript/mastodon/features/status/index.jsx | 2 +- .../mastodon/features/ui/components/modal_root.jsx | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/javascript/mastodon/features/explore/results.jsx b/app/javascript/mastodon/features/explore/results.jsx index bf2f0b95a..7d1ce69ad 100644 --- a/app/javascript/mastodon/features/explore/results.jsx +++ b/app/javascript/mastodon/features/explore/results.jsx @@ -108,10 +108,10 @@ class Results extends PureComponent { return ( <>
- - - - + + + +
diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx index f1d591c73..799354d18 100644 --- a/app/javascript/mastodon/features/status/index.jsx +++ b/app/javascript/mastodon/features/status/index.jsx @@ -568,7 +568,7 @@ class Status extends ImmutablePureComponent { onMoveUp={this.handleMoveUp} onMoveDown={this.handleMoveDown} contextType='thread' - previousId={i > 0 && list.get(i - 1)} + previousId={i > 0 ? list.get(i - 1) : undefined} nextId={list.get(i + 1) || (ancestors && statusId)} rootId={statusId} /> diff --git a/app/javascript/mastodon/features/ui/components/modal_root.jsx b/app/javascript/mastodon/features/ui/components/modal_root.jsx index fb6acfaea..f6de5dad3 100644 --- a/app/javascript/mastodon/features/ui/components/modal_root.jsx +++ b/app/javascript/mastodon/features/ui/components/modal_root.jsx @@ -115,7 +115,10 @@ export default class ModalRoot extends PureComponent { {visible && ( <> - {(SpecificComponent) => } + {(SpecificComponent) => { + const ref = typeof SpecificComponent !== 'function' ? this.setModalRef : undefined; + return + }}