@@ -57,23 +57,6 @@ module Make = (
57
57
"inactiveTintColor" : option <string >,
58
58
}
59
59
60
- @obj
61
- external bottomTabBarOptions : (
62
- ~keyboardHidesTabBar : bool = ?,
63
- ~activeTintColor : string = ?,
64
- ~inactiveTintColor : string = ?,
65
- ~activeBackgroundColor : string = ?,
66
- ~inactiveBackgroundColor : string = ?,
67
- ~allowFontScaling : bool = ?,
68
- ~showLabel : bool = ?,
69
- ~labelStyle : ReactNative .Style .t = ?,
70
- ~tabStyle : ReactNative .Style .t = ?,
71
- ~labelPosition : labelPositionArgs => string = ?,
72
- ~adaptive : bool = ?,
73
- ~style : ReactNative .Style .t = ?,
74
- unit ,
75
- ) => bottomTabBarOptions = ""
76
-
77
60
type accessibilityRole = string
78
61
type accessibilityStates = array <string >
79
62
type routeArgs = {route : route }
@@ -113,14 +96,31 @@ module Make = (
113
96
@obj
114
97
external options : (
115
98
~title : string = ?,
116
- ~tabBarLabel : //TODO: dynamic, missing static option: React.ReactNode
117
- tabBarLabelArgs => React .element = ?,
99
+ ~unmountOnBlur : bool = ?,
100
+ ~_lazy : bool = ?,
101
+ ~showIcon : bool = ?,
102
+ // TODO: Use @react-navigation/elements and add header-related options
103
+ // https://reactnavigation.org/docs/bottom-tab-navigator/#header-related-options
104
+ // https://github.com/rescript-react-native/rescript-react-navigation/pull/47
105
+ // ~header: 'header=?,
106
+ ~headerShown : bool = ?,
107
+ ~tabBarLabel : tabBarLabelArgs => React .element = ?, //TODO: dynamic, missing static option: React.ReactNode
118
108
~tabBarIcon : tabBarIconArgs => React .element = ?,
119
109
~tabBarAccessibilityLabel : string = ?,
120
110
~tabBarTestID : string = ?,
121
- ~tabBarVisible : bool = ?,
122
111
~tabBarButton : React .element = ?,
123
- ~unmountOnBlur : bool = ?,
112
+ ~tabBarHideOnKeyboard : bool = ?,
113
+ ~tabBarActiveTintColor : string = ?,
114
+ ~tabBarInactiveTintColor : string = ?,
115
+ ~tabBarActiveBackgroundColor : string = ?,
116
+ ~tabBarInactiveBackgroundColor : string = ?,
117
+ ~tabBarAllowFontScaling : bool = ?,
118
+ ~tabBarShowLabel : bool = ?,
119
+ ~tabBarLabelPosition : labelPositionArgs => string = ?,
120
+ ~tabBarLabelStyle : ReactNative .Style .t = ?,
121
+ ~tabBarItemStyle : ReactNative .Style .t = ?,
122
+ ~tabBarStyle : ReactNative .Style .t = ?,
123
+ ~tabBarBackground : unit => React .element = ?,
124
124
unit ,
125
125
) => options = ""
126
126
@@ -131,13 +131,13 @@ module Make = (
131
131
132
132
type optionsCallback = optionsProps => options
133
133
134
+ type groupProps = {screenOptions : option <optionsCallback >}
135
+
134
136
type navigatorProps = {
135
137
initialRouteName : option <string >,
136
138
screenOptions : option <optionsCallback >,
137
139
backBehavior : option <string >,
138
- _lazy : option <bool >,
139
140
tabBar : option <bottomTabBarProps => React .element >,
140
- tabBarOptions : option <bottomTabBarOptions >,
141
141
}
142
142
143
143
type renderCallbackProp = {
@@ -157,6 +157,7 @@ module Make = (
157
157
external make : unit => {
158
158
"Navigator" : navigatorProps => React .element ,
159
159
"Screen" : screenProps <M .params > => React .element ,
160
+ "Group" : groupProps => React .element ,
160
161
} = "createBottomTabNavigator"
161
162
162
163
let bottomTabs = make ()
@@ -193,14 +194,24 @@ module Make = (
193
194
~initialRouteName : string = ?,
194
195
~screenOptions : optionsCallback = ?,
195
196
~children : React .element ,
196
- ~backBehavior : [#initialRoute | #order | #history | #none ]= ?,
197
+ ~backBehavior : [#firstRoute | # initialRoute | #order | #history | #none ]= ?,
197
198
~_lazy : bool = ?,
198
199
~tabBar : bottomTabBarProps => React .element = ?,
199
- ~tabBarOptions : bottomTabBarOptions = ?,
200
200
~key : string = ?,
201
201
unit ,
202
202
) => navigatorProps = ""
203
203
204
204
let make = bottomTabs ["Navigator" ]
205
205
}
206
+
207
+ module Group = {
208
+ @obj
209
+ external makeProps : (
210
+ ~screenOptions : optionsCallback = ?,
211
+ ~children : React .element ,
212
+ ~key : string = ?,
213
+ unit ,
214
+ ) => groupProps = ""
215
+ let make = bottomTabs ["Group" ]
216
+ }
206
217
}
0 commit comments