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 bf2f0b95adb71ed8b30b1e378a52abe7336ba2f1..7d1ce69ad00d7899a6dc5dd379bd70362ca6be8f 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 f1d591c73f5dbce42470540400fa06580709f1e3..799354d183c7dfc1b89ff7063617ac72ed49878c 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 fb6acfaeaa9dd72cd48caad43b9f7efc07faa759..f6de5dad356d5ff5d12b2c44aaa6703324ca7d5a 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 + }}