Skip to content

Commit

Permalink
remove duplicate from HocBadges
Browse files Browse the repository at this point in the history
  • Loading branch information
bl00mber committed May 9, 2020
1 parent 6a830d3 commit dfe553e
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,12 @@ type Props = {|
export default function HocBadges({element}: Props) {
const {hocDisplayNames, type} = ((element: any): Element);

let typeBadge = null;
if (type === ElementTypeMemo) {
typeBadge = 'Memo';
} else if (type === ElementTypeForwardRef) {
typeBadge = 'ForwardRef';
}

if (hocDisplayNames === null && typeBadge === null) {
if (hocDisplayNames === null) {
return null;
}

return (
<div className={styles.HocBadges}>
{typeBadge !== null && <div className={styles.Badge}>{typeBadge}</div>}
{hocDisplayNames !== null &&
hocDisplayNames.map(hocDisplayName => (
<div key={hocDisplayName} className={styles.Badge}>
Expand Down

0 comments on commit dfe553e

Please sign in to comment.