1+ // Low-level, zero-cost bindings to AppContainer.
2+ //
3+ // Usage:
4+ //
5+ // let appContainer = AppContainer.makeAppContainer(rootNavigator);
6+ //
7+ // React.createElement(
8+ // appContainer,
9+ // AppContainer.makeProps(
10+ // ~screenProps, /* ... more props ... */
11+ // (),
12+ // ),
13+ // );
14+
115type persistNavigationState = NavigationState . t => Js . Promise . t (unit );
216type loadNavigationState = unit => Js . Promise . t (option (NavigationState . t ));
317
@@ -9,27 +23,20 @@ type appContainerProps('screenProps) = {
923 "setNavigatorRef" : Js . Nullable . t(NavigationContainer . t) => unit,
1024};
1125
12- module Make = (S : {
13- type screenProps ;
14- let navigator : Navigator . t ;
15- }) => {
16- [@ bs . module "react-navigation" ]
17- external make :
18- Navigator . t => React . component (appContainerProps (S . screenProps )) =
19- "createAppContainer" ;
20-
21- [@ bs . obj ]
22- external makeProps :
23- (
24- ~persistNavigationState : persistNavigationState =?,
25- ~loadNavigationState : loadNavigationState =?,
26- ~screenProps : S . screenProps =?,
27- ~setNavigatorRef : Js . Nullable . t (NavigationContainer . t ) => unit =?,
28- ~key : string =?,
29- unit
30- ) =>
31- appContainerProps (S . screenProps ) =
32- "" ;
26+ [@ bs . obj ]
27+ external makeProps :
28+ (
29+ ~persistNavigationState : persistNavigationState =?,
30+ ~loadNavigationState : loadNavigationState =?,
31+ ~screenProps : ' screenProps =?,
32+ ~setNavigatorRef : Js . Nullable . t (NavigationContainer . t ) => unit =?,
33+ ~key : string =?,
34+ unit
35+ ) =>
36+ appContainerProps (' screenProps ) =
37+ "" ;
3338
34- let make = make(S . navigator);
35- };
39+ [@ bs . module "react-navigation" ]
40+ external makeAppContainer :
41+ Navigator . t => React . component (appContainerProps (' screenProps )) =
42+ "createAppContainer" ;
0 commit comments