From 00d45fff829bee76074e5f9e6a6ada7c2ac79a05 Mon Sep 17 00:00:00 2001 From: freddy Date: Mon, 17 Aug 2020 12:59:05 +0200 Subject: [PATCH 1/2] add ref props to navigation container --- src/Native.re | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Native.re b/src/Native.re index 2274cfcd..ff0f1027 100644 --- a/src/Native.re +++ b/src/Native.re @@ -99,6 +99,7 @@ module NavigationContainer = { [@bs.module "@react-navigation/native"] [@react.component] external make: ( + ~ref: ReactNative.NativeElement.ref=?, ~initialState: state=?, ~onStateChange: navigationState=?, ~children: React.element From f62f0a0e237ff385ed84bf1ac3395ba28e3f26f0 Mon Sep 17 00:00:00 2001 From: freddy Date: Mon, 17 Aug 2020 17:49:41 +0200 Subject: [PATCH 2/2] add key props for components --- src/BottomTabs.re | 3 +++ src/Drawer.re | 2 ++ src/MaterialBottomTabs.re | 3 +++ src/MaterialTopTabs.re | 3 +++ src/Stack.re | 3 +++ 5 files changed, 14 insertions(+) diff --git a/src/BottomTabs.re b/src/BottomTabs.re index 60b5079f..d87403c1 100644 --- a/src/BottomTabs.re +++ b/src/BottomTabs.re @@ -185,6 +185,7 @@ module Make = (M: {type params;}) => { "navigation": navigation, "route": route, }), + ~key: string=?, unit ) => screenProps(M.params); @@ -199,6 +200,7 @@ module Make = (M: {type params;}) => { ~options: optionsCallback=?, ~initialParams: M.params=?, ~children: renderCallbackProp => React.element, + ~key: string=?, unit ) => screenProps(M.params); @@ -222,6 +224,7 @@ module Make = (M: {type params;}) => { ~_lazy: bool=?, ~tabBar: Js.t(bottomTabBarProps) => React.element=?, ~tabBarOptions: bottomTabBarOptions=?, + ~key: string=?, unit ) => navigatorProps; diff --git a/src/Drawer.re b/src/Drawer.re index a70cfe54..dde6e053 100644 --- a/src/Drawer.re +++ b/src/Drawer.re @@ -113,6 +113,7 @@ module Make = (M: {type params;}) => { "navigation": navigation, "route": route(M.params), }), + ~key: string=?, unit ) => screenProps; @@ -162,6 +163,7 @@ module Make = (M: {type params;}) => { ~drawerContentOptions: Js.t(contentOptions)=?, ~sceneContainerStyle: ReactNative.Style.t=?, ~style: ReactNative.Style.t=?, + ~key: string=?, unit ) => navigatorProps; diff --git a/src/MaterialBottomTabs.re b/src/MaterialBottomTabs.re index 331ee262..5014b795 100644 --- a/src/MaterialBottomTabs.re +++ b/src/MaterialBottomTabs.re @@ -124,6 +124,7 @@ module Make = (M: {type params;}) => { ~options: optionsCallback=?, ~initialParams: M.params=?, ~component: React.component({. "navigation": navigation}), + ~key: string=?, unit ) => screenProps(M.params); @@ -138,6 +139,7 @@ module Make = (M: {type params;}) => { ~options: optionsCallback=?, ~initialParams: M.params=?, ~children: renderCallbackProp => React.element, + ~key: string=?, unit ) => screenProps(M.params); @@ -164,6 +166,7 @@ module Make = (M: {type params;}) => { ~inactiveColor: string=?, ~barStyle: ReactNative.Style.t=?, //TODO: More? https://github.com/callstack/react-native-paper/blob/bd4296116d841ed355f3dbebb40cfbc3b87a79ff/src/components/BottomNavigation.tsx#L132-L196 + ~key: string=?, unit ) => navigatorProps; diff --git a/src/MaterialTopTabs.re b/src/MaterialTopTabs.re index 39348fef..b03fc7fc 100644 --- a/src/MaterialTopTabs.re +++ b/src/MaterialTopTabs.re @@ -179,6 +179,7 @@ module Make = (M: {type params;}) => { ~options: optionsCallback=?, ~initialParams: M.params=?, ~component: React.component({. "navigation": navigation}), + ~key: string=?, unit ) => screenProps(M.params); @@ -193,6 +194,7 @@ module Make = (M: {type params;}) => { ~options: optionsCallback=?, ~initialParams: M.params=?, ~children: renderCallbackProp => React.element, + ~key: string=?, unit ) => screenProps(M.params); @@ -230,6 +232,7 @@ module Make = (M: {type params;}) => { ~swipeVelocityImpact: float=?, ~sceneContainerStyle: ReactNative.Style.t=?, ~style: ReactNative.Style.t=?, + ~key: string=?, unit ) => navigatorProps; diff --git a/src/Stack.re b/src/Stack.re index 07989588..30f7941d 100644 --- a/src/Stack.re +++ b/src/Stack.re @@ -305,6 +305,7 @@ module Make = (M: {type params;}) => { ~options: optionsCallback=?, ~initialParams: M.params=?, ~children: renderCallbackProp => React.element, + ~key: string=?, unit ) => screenProps(M.params); @@ -323,6 +324,7 @@ module Make = (M: {type params;}) => { "navigation": navigation, "route": route, }), + ~key: string=?, unit ) => screenProps(M.params); @@ -340,6 +342,7 @@ module Make = (M: {type params;}) => { ~headerMode: [@bs.string] [ | `float | `screen | `none]=?, ~keyboardHandlingEnabled: bool=?, ~children: React.element, + ~key: string=?, unit ) => navigatorProps;