From def58f8ac335130323f05adecca09a789a76031a Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Wed, 23 Aug 2023 15:43:41 +0200 Subject: [PATCH] [Glitch] Fix some React warnings Port 152b10b6246987bfb2cc73ecd2a20578d05b62dc to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/explore/results.jsx | 8 ++++---- app/javascript/flavours/glitch/features/status/index.jsx | 2 +- .../flavours/glitch/features/ui/components/modal_root.jsx | 5 ++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/javascript/flavours/glitch/features/explore/results.jsx b/app/javascript/flavours/glitch/features/explore/results.jsx index 724aa02902..699105e0d6 100644 --- a/app/javascript/flavours/glitch/features/explore/results.jsx +++ b/app/javascript/flavours/glitch/features/explore/results.jsx @@ -110,10 +110,10 @@ class Results extends PureComponent { return ( <>
- - - - + + + +
diff --git a/app/javascript/flavours/glitch/features/status/index.jsx b/app/javascript/flavours/glitch/features/status/index.jsx index 9247fcc5bb..457314db66 100644 --- a/app/javascript/flavours/glitch/features/status/index.jsx +++ b/app/javascript/flavours/glitch/features/status/index.jsx @@ -595,7 +595,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/flavours/glitch/features/ui/components/modal_root.jsx b/app/javascript/flavours/glitch/features/ui/components/modal_root.jsx index 7e94141fb8..94adbf8f83 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_root.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.jsx @@ -126,7 +126,10 @@ export default class ModalRoot extends PureComponent { {visible && ( <> - {(SpecificComponent) => } + {(SpecificComponent) => { + const ref = typeof SpecificComponent !== 'function' ? this.setModalRef : undefined; + return + }}