From ea9cfef574068952813a900b188ba3cdee73dba9 Mon Sep 17 00:00:00 2001 From: Bart Akeley Date: Sun, 5 Apr 2020 12:41:20 -0500 Subject: [PATCH] fix back button for create screen --- js/pages/Nav.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/pages/Nav.js b/js/pages/Nav.js index 6cd6f50..8ea1b5a 100644 --- a/js/pages/Nav.js +++ b/js/pages/Nav.js @@ -23,7 +23,7 @@ type Props = { }; const Nav = (props: Props) => { - const { activeTab, setRoute, location } = props; + const { activeTab, setRoute, location, pushRoute } = props; return ( @@ -60,7 +60,7 @@ const Nav = (props: Props) => { key="add" icon="add-circle" label="Add" - onPress={setRoute(`/createFoodItem?backto=${location.pathname}`)} + onPress={pushRoute(`/createFoodItem?backto=${location.pathname}`)} style={{ container: { minWidth: 40, @@ -106,5 +106,8 @@ export default compose( setRoute: (props: Props) => (route: string) => () => { props.router.history.replace(route); }, + pushRoute: (props: Props) => (route: string) => () => { + props.router.history.push(route); + }, }) )(Nav);