Skip to content

Commit

Permalink
fix(switch): render text or children, not both
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones committed Oct 22, 2021
1 parent 06b9b97 commit 3720382
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/components/Switch/Switch.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ const Switch = React.forwardRef(function Switch(props, tabRef) {
{...other}
{...commonProps}>
<span className={`${prefix}--content-switcher__label`} title={text}>
{text}
{children}
{text !== undefined ? text : children}
</span>
</button>
);
Expand Down

0 comments on commit 3720382

Please sign in to comment.