Skip to content

Commit dd59076

Browse files
committed
Button: simplify hasIconOnly
1 parent 5b1d152 commit dd59076

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/components/Button/Button.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ const ButtonComponent: React.FC<ButtonProps> = ({
160160
}) => {
161161
const platform = usePlatform();
162162
const hasIcons = Boolean(before || after);
163-
const hasIconOnly = Boolean(
164-
(!children && !after && before) || (!children && after && !before)
165-
);
163+
const hasIconOnly = !children && Boolean(after) !== Boolean(before);
166164
const { resolvedMode, resolvedAppearance } = resolveButtonAppearance(
167165
appearance,
168166
mode

0 commit comments

Comments
 (0)