@@ -89,8 +89,7 @@ module TransitionSpec = {
8989 };
9090 [@ bs . obj ]
9191 external spring :
92- (~animation : [@ bs . string ] [ | ` spring ] , ~config : springConfig ) => t =
93- "" ;
92+ (~animation : [@ bs . string ] [ | ` spring ] , ~config : springConfig ) => t ;
9493
9594 type timingConfig = {
9695 duration: int ,
@@ -99,8 +98,7 @@ module TransitionSpec = {
9998
10099 [@ bs . obj ]
101100 external timing :
102- (~animation : [@ bs . string ] [ | ` timing ] , ~config : timingConfig ) => t =
103- "" ;
101+ (~animation : [@ bs . string ] [ | ` timing ] , ~config : timingConfig ) => t ;
104102};
105103
106104type transitionSpec = {
@@ -136,8 +134,7 @@ module Make = (M: {type params;}) => {
136134 type gestureResponseDistance ;
137135 [@ bs . obj ]
138136 external gestureResponseDistance :
139- (~vertical : float =?, ~horizontal : float =?, unit ) => gestureResponseDistance =
140- "" ;
137+ (~vertical : float =?, ~horizontal : float =?, unit ) => gestureResponseDistance ;
141138
142139 module HeaderTitle = {
143140 type t ;
@@ -251,8 +248,7 @@ module Make = (M: {type params;}) => {
251248 ~headerStyleInterpolator : stackHeaderStyleInterpolator =?,
252249 unit
253250 ) =>
254- options =
255- "" ;
251+ options ;
256252 type optionsProps = {
257253 navigation,
258254 route,
@@ -266,17 +262,23 @@ module Make = (M: {type params;}) => {
266262 headerMode: option (string ),
267263 keyboardHandlingEnabled: option (bool ),
268264 };
269-
265+ type renderCallbackProp = {
266+ navigation,
267+ route,
268+ };
270269 type screenProps (' params ) = {
271270 name: string,
272271 options: option(optionCallback),
273272 initialParams: option('params),
274273 component:
275- React . component({
276- .
277- "navigation" : navigation,
278- "route" : route,
279- }),
274+ option(
275+ React . component({
276+ .
277+ "navigation" : navigation,
278+ "route" : route,
279+ }),
280+ ),
281+ children: option(renderCallbackProp => React . element),
280282 };
281283
282284 [@ bs . module "@react-navigation/stack" ]
@@ -290,7 +292,19 @@ module Make = (M: {type params;}) => {
290292 "createStackNavigator" ;
291293
292294 let stack = make() ;
293-
295+ module ScreenWithCallback = {
296+ [@ bs . obj ]
297+ external makeProps :
298+ (
299+ ~name : string ,
300+ ~options : optionCallback =?,
301+ ~initialParams : M . params =?,
302+ ~children : renderCallbackProp => React . element ,
303+ unit
304+ ) =>
305+ screenProps (M . params );
306+ let make = stack## "Screen" ;
307+ };
294308 module Screen = {
295309 type componentProps = {navigation};
296310 [@ bs . obj ]
@@ -306,8 +320,8 @@ module Make = (M: {type params;}) => {
306320 }),
307321 unit
308322 ) =>
309- screenProps (M . params ) =
310- "" ;
323+ screenProps (M . params );
324+
311325 let make = stack## "Screen" ;
312326 };
313327
@@ -323,8 +337,7 @@ module Make = (M: {type params;}) => {
323337 ~children : React . element ,
324338 unit
325339 ) =>
326- navigatorProps =
327- "" ;
340+ navigatorProps ;
328341
329342 let make = stack## "Navigator" ;
330343 };
0 commit comments