Skip to content

Conversation

lukewalczak
Copy link
Member

Motivation

Changed the condition from badge && (...) to badge !== false && (...) to properly handle the case when badge === 0.
This ensures that numeric badges with value 0 are displayed correctly within the Badge component rather than being improperly rendered as plain text.
The previous implementation caused JavaScript to evaluate 0 && (...) as falsy, resulting in the Badge component wrapper being skipped when the badge value was zero.

Related issue

Fixes: #4492

Test plan

Copy link

The mobile version of example app from this branch is ready! You can see it here.

@lukewalczak lukewalczak merged commit ff58b00 into main Apr 25, 2025
3 checks passed
@lukewalczak lukewalczak added this to the 5.13.5 milestone Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Badge errors with Text strings must be rendered within a <Text> component
1 participant