@@ -57,23 +57,6 @@ module Make = (
5757 "inactiveTintColor" : option <string >,
5858 }
5959
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-
7760 type accessibilityRole = string
7861 type accessibilityStates = array <string >
7962 type routeArgs = {route : route }
@@ -113,14 +96,31 @@ module Make = (
11396 @obj
11497 external options : (
11598 ~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
118108 ~tabBarIcon : tabBarIconArgs => React .element = ?,
119109 ~tabBarAccessibilityLabel : string = ?,
120110 ~tabBarTestID : string = ?,
121- ~tabBarVisible : bool = ?,
122111 ~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 = ?,
124124 unit ,
125125 ) => options = ""
126126
@@ -131,13 +131,13 @@ module Make = (
131131
132132 type optionsCallback = optionsProps => options
133133
134+ type groupProps = {screenOptions : option <optionsCallback >}
135+
134136 type navigatorProps = {
135137 initialRouteName : option <string >,
136138 screenOptions : option <optionsCallback >,
137139 backBehavior : option <string >,
138- _lazy : option <bool >,
139140 tabBar : option <bottomTabBarProps => React .element >,
140- tabBarOptions : option <bottomTabBarOptions >,
141141 }
142142
143143 type renderCallbackProp = {
@@ -157,6 +157,7 @@ module Make = (
157157 external make : unit => {
158158 "Navigator" : navigatorProps => React .element ,
159159 "Screen" : screenProps <M .params > => React .element ,
160+ "Group" : groupProps => React .element ,
160161 } = "createBottomTabNavigator"
161162
162163 let bottomTabs = make ()
@@ -193,14 +194,24 @@ module Make = (
193194 ~initialRouteName : string = ?,
194195 ~screenOptions : optionsCallback = ?,
195196 ~children : React .element ,
196- ~backBehavior : [#initialRoute | #order | #history | #none ]= ?,
197+ ~backBehavior : [#firstRoute | # initialRoute | #order | #history | #none ]= ?,
197198 ~_lazy : bool = ?,
198199 ~tabBar : bottomTabBarProps => React .element = ?,
199- ~tabBarOptions : bottomTabBarOptions = ?,
200200 ~key : string = ?,
201201 unit ,
202202 ) => navigatorProps = ""
203203
204204 let make = bottomTabs ["Navigator" ]
205205 }
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+ }
206217}
0 commit comments