2 ms·
I would flag the solution code in a code review because the Badge is not a composable component and still concerns itself with passing in the styles from outsid
by 5Qn8mNbc2FNCiVV 4y ago
I would flag the solution code in a code review because the Badge is not a composable component and still concerns itself with passing in the styles from outside. If it would have accepted any children and only provided the box, it should have included the minimum styles for styling the border and making the spacing consistent and leave the children up for insertion.
Like this:
<Badge>
<Avatar img={user.img}>
<div>
...
However if the Badge should be concerned exactly with that use-case, it should not even allow having so much flexibility over the styles and it should be called something else because the name "Badge" is too valueable to waste / misleading at best. "AvatarBadge" would have done it better