Skip to content

Commit b77432d

Browse files
authored
Improve stack and material top tabs (#51)
* Improve `Stack` by adding: - `headerBackTestID` screen option - `getId` screen prop * Add `swipeEnabled` option to `MaterialTopTabs`
1 parent 289a117 commit b77432d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/MaterialTopTabs.res

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ module Make = (
112112
~tabBarTestID: string=?,
113113
~_lazy: bool=?,
114114
~lazyPlaceholder: React.component<{"route": route}>=?,
115+
~swipeEnabled: bool=?,
115116
~tabBarActiveTintColor: string=?,
116117
~tabBarInactiveTintColor: string=?,
117118
~tabBarPressColor: string=?,
@@ -224,6 +225,8 @@ module Make = (
224225
| @as("on-drag") #onDrag
225226
| #none
226227
]=?,
228+
// Setting `swipeEnabled` through props is deprecated.
229+
// Set it through screen options instead!
227230
~swipeEnabled: bool=?,
228231
~swipeVelocityImpact: float=?,
229232
~sceneContainerStyle: ReactNative.Style.t=?,

src/Stack.res

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ module Make = (
226226
~headerBackAllowFontScaling: bool=?,
227227
~headerBackground: headerBackgroundOptions => React.element=?,
228228
~headerBackImage: backImage=?,
229+
~headerBackTestID: string=?,
229230
~headerBackTitle: string=?,
230231
~headerBackTitleStyle: ReactNative.Style.t=?,
231232
~headerBackTitleVisible: bool=?,
@@ -260,6 +261,9 @@ module Make = (
260261
}
261262
type optionsCallback = optionsProps => options
262263

264+
type getIdProps = {params: M.params}
265+
type getIdCallback = getIdProps => option<string>
266+
263267
type groupProps = {screenOptions: option<optionsCallback>}
264268

265269
type navigatorProps = {
@@ -273,6 +277,7 @@ module Make = (
273277
type screenProps<'params> = {
274278
name: string,
275279
options: option<optionsCallback>,
280+
getId: option<getIdCallback>,
276281
initialParams: option<'params>,
277282
component: option<React.component<{"navigation": navigation, "route": route}>>,
278283
children: option<renderCallbackProp => React.element>,
@@ -291,6 +296,7 @@ module Make = (
291296
external makeProps: (
292297
~name: string,
293298
~options: optionsCallback=?,
299+
~getId: getIdCallback=?,
294300
~initialParams: M.params=?,
295301
~children: renderCallbackProp => React.element,
296302
~key: string=?,
@@ -304,6 +310,7 @@ module Make = (
304310
external makeProps: (
305311
~name: string,
306312
~options: optionsCallback=?,
313+
~getId: getIdCallback=?,
307314
~initialParams: M.params=?,
308315
~component: React.component<{"navigation": navigation, "route": route}>,
309316
~key: string=?,

0 commit comments

Comments
 (0)