Skip to content

Commit

Permalink
feat: pass route to badge function
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Mar 29, 2024
1 parent bb78960 commit f040776
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-native-tab-view/src/TabBarItem.tsx
Expand Up @@ -240,7 +240,7 @@ const TabBarItemInternal = <T extends Route>({
</Animated.View>
</View>
{customBadge != null ? (
<View style={styles.badge}>{customBadge()}</View>
<View style={styles.badge}>{customBadge({ route })}</View>
) : null}
</View>
</PlatformPressable>
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-tab-view/src/types.tsx
Expand Up @@ -22,7 +22,7 @@ export type TabDescriptor<T extends Route> = {
color: string;
size: number;
}) => React.ReactElement;
badge?: () => React.ReactElement;
badge?: (props: { route: T }) => React.ReactElement;
};

export type LocaleDirection = 'ltr' | 'rtl';
Expand Down

0 comments on commit f040776

Please sign in to comment.