From b8afdc71aead7b259da9963c6c4f8c67c1ff63fe Mon Sep 17 00:00:00 2001 From: Thomas Deconinck Date: Fri, 14 Feb 2020 22:02:07 +0100 Subject: [PATCH 1/4] add route params to Drawer screen component props --- src/Drawer.re | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Drawer.re b/src/Drawer.re index f48499a0..75c091f7 100644 --- a/src/Drawer.re +++ b/src/Drawer.re @@ -109,7 +109,11 @@ module Make = (M: {type params;}) => { ~name: string, ~options: optionsCallback=?, ~initialParams: M.params=?, - ~component: React.component({. "navigation": navigation}), + ~component: React.component({ + . + "navigation": navigation, + "route": route(M.params), + }), unit ) => screenProps = From 05b757c66d32af2e5998ca05b35ce7312e057b1b Mon Sep 17 00:00:00 2001 From: Thomas Deconinck Date: Mon, 17 Feb 2020 10:56:29 +0100 Subject: [PATCH 2/4] rename NavigationNativeContainer into NavigationContainer --- src/Native.bs.js | 4 ++-- src/Native.re | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Native.bs.js b/src/Native.bs.js index e3dc5a47..4219e579 100644 --- a/src/Native.bs.js +++ b/src/Native.bs.js @@ -1,7 +1,7 @@ 'use strict'; -var NavigationNativeContainer = { }; +var NavigationContainer = { }; -exports.NavigationNativeContainer = NavigationNativeContainer; +exports.NavigationContainer = NavigationContainer; /* No side effect */ diff --git a/src/Native.re b/src/Native.re index 989c505a..9bff3db2 100644 --- a/src/Native.re +++ b/src/Native.re @@ -92,7 +92,7 @@ ``` */ -module NavigationNativeContainer = { +module NavigationContainer = { type state = Js.Json.t; type navigationState = state => unit; @@ -104,7 +104,7 @@ module NavigationNativeContainer = { ~children: React.element ) => React.element = - "NavigationNativeContainer"; + "NavigationContainer"; }; [@bs.module "@react-navigation/native"] From f7e2f9d14a123c6e3eabdc6ded11eeaa4fbeaaa3 Mon Sep 17 00:00:00 2001 From: Thomas Deconinck Date: Mon, 17 Feb 2020 11:15:22 +0100 Subject: [PATCH 3/4] fix example --- src/Example.bs.js | 2 +- src/Example.re | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Example.bs.js b/src/Example.bs.js index dfc41b9c..5abd0ec1 100644 --- a/src/Example.bs.js +++ b/src/Example.bs.js @@ -90,7 +90,7 @@ var $$Screen$1 = include$1.Screen; var $$Navigator$1 = include$1.Navigator; function Example$RootStackScreen(Props) { - return React.createElement(Native.NavigationNativeContainer, { + return React.createElement(Native.NavigationContainer, { children: React.createElement($$Navigator$1.make, { mode: "modal", headerMode: "none", diff --git a/src/Example.re b/src/Example.re index a068c6fa..e6ec35ef 100644 --- a/src/Example.re +++ b/src/Example.re @@ -53,10 +53,10 @@ module RootStackScreen = { }); [@react.component] let make = () => - + - ; + ; }; From d222cdb58eb8c35f53dde5ff35eb03afc512e861 Mon Sep 17 00:00:00 2001 From: Thomas Deconinck Date: Fri, 21 Feb 2020 18:49:21 +0100 Subject: [PATCH 4/4] add route props to BottomTabs Screen component --- src/BottomTabs.re | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/BottomTabs.re b/src/BottomTabs.re index d2ef0d66..876367d4 100644 --- a/src/BottomTabs.re +++ b/src/BottomTabs.re @@ -156,7 +156,11 @@ module Make = (M: {type params;}) => { ~name: string, ~options: optionsCallback=?, ~initialParams: M.params=?, - ~component: React.component({. "navigation": navigation}), + ~component: React.component({ + . + "navigation": navigation, + "route": route(M.params), + }), unit ) => screenProps =