Skip to content

Commit 7035fb5

Browse files
committed
fix: 🐛 null check for badge count array
1 parent 2dc1198 commit 7035fb5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

example/src/SegmentedControl.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const SegmentedControl: React.FC<SegmentedControlProps> = ({
154154
>
155155
{segment}
156156
</Text>
157-
{badgeCount[index] > 0 && (
157+
{badgeCount[index] && (
158158
<View
159159
style={[
160160
styles.defaultBadgeContainerStyle,

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const SegmentedControl: React.FC<SegmentedControlProps> = ({
154154
>
155155
{segment}
156156
</Text>
157-
{badgeCount[index] > 0 && (
157+
{badgeCount[index] && (
158158
<View
159159
style={[
160160
styles.defaultBadgeContainerStyle,

0 commit comments

Comments
 (0)