Skip to content

Commit a9b3e79

Browse files
committed
tabBarLabel polymorphic
1 parent fd1d0e7 commit a9b3e79

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/BottomTabs.res

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ module TabBarBadge = {
1818
external string: string => t = "%identity"
1919
}
2020

21+
@unboxed
22+
type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element)
23+
and tabBarLabelArgs = {focused: bool, color: string}
24+
2125
type rec options = {
2226
title?: string,
23-
tabBarLabel?: string,
27+
tabBarLabel?: tabBarLabel,
2428
tabBarShowLabel?: bool,
2529
tabBarLabelPosition?: tabBarLabelPosition,
2630
tabBarLabelStyle?: Style.t,

src/MaterialBottomTabs.res

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ module TabBarBadge = {
1616
external string: string => t = "%identity"
1717
}
1818

19+
@unboxed
20+
type rec tabBarLabel = String(string) | Function(tabBarLabelArgs => React.element)
21+
and tabBarLabelArgs = {focused: bool, color: string}
22+
1923
type options = {
2024
title?: string,
2125
tabBarIcon?: tabBarIconOptions => React.element,
2226
tabBarColor?: Color.t,
23-
tabBarLabel?: string,
27+
tabBarLabel?: tabBarLabel,
2428
tabBarBadge?: TabBarBadge.t,
2529
tabBarAccessibilityLabel?: string,
2630
tabBarTestID?: string,

0 commit comments

Comments
 (0)