From 82cd138c89730279205a0dccab4ee5c39f92b342 Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Sat, 29 Jun 2019 10:43:45 +0200 Subject: [PATCH] Fix some React warnings --- .../glitch/components/intersection_observer_article.js | 2 +- .../flavours/glitch/components/status_action_bar.js | 8 ++++---- .../glitch/features/local_settings/page/item/index.js | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.js b/app/javascript/flavours/glitch/components/intersection_observer_article.js index 900c986380b..295347c29f1 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.js +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.js @@ -119,7 +119,7 @@ export default class IntersectionObserverArticle extends ImmutablePureComponent data-id={id} tabIndex='0' style={style}> - {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || cachedHeight) })} + {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} ); } diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index 85bc4a9760d..c424fbde135 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -284,11 +284,11 @@ export default class StatusActionBar extends ImmutablePureComponent {
{replyButton} {!directMessage && [ - , - , + , + , shareButton, - , -
+ , +
, ]} diff --git a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js index 66b937365db..5a68523f62d 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js @@ -8,7 +8,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes'; export default class LocalSettingsPageItem extends React.PureComponent { static propTypes = { - children: PropTypes.element.isRequired, + children: PropTypes.node.isRequired, dependsOn: PropTypes.array, dependsOnNot: PropTypes.array, id: PropTypes.string.isRequired, @@ -63,12 +63,12 @@ export default class LocalSettingsPageItem extends React.PureComponent { disabled={!enabled} /> {opt.message} - {opt.hint && {opt.hint}} + {opt.hint && {opt.hint}} ); }); return ( -
+
{children} {optionElems}