score:1

Accepted answer
showCollapseButton && (
      <div>
        <FormattedMessage id="headerText.showMore" />
        <Image
          src={arrowDownImageUrl}
        />
      </div>
      )

score:0

const example = () => {
    return (true && 
            'bar')
}
console.log(example())

score:1

const CollapseButton = ({ showCollapseButton }) => {
    return showCollapseButton && (
      <div>
        <FormattedMessage id="headerText.showMore" />
        <Image
          src={arrowDownImageUrl}
        />
      </div>
      )
};

CollapseButton.propTypes = {
  showCollapseButton: PropTypes.bool.isRequired,
};

export const CollapseButton;

Related Query

More Query from same tag