From 0e225096ca6fe14483e929960ce5ca8b757c0d45 Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Fri, 23 Feb 2018 16:01:29 -0800 Subject: [PATCH 1/2] Add RFC for less pushy navigate --- text/0000-less-pushy-navigate.md | 113 +++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 text/0000-less-pushy-navigate.md diff --git a/text/0000-less-pushy-navigate.md b/text/0000-less-pushy-navigate.md new file mode 100644 index 0000000..7a6890e --- /dev/null +++ b/text/0000-less-pushy-navigate.md @@ -0,0 +1,113 @@ +- Start Date: 2018-02-23 +- RFC PR: (leave this empty) +- React Navigation Issue: (leave this empty) + +# Summary + +This RFC suggests making the `navigate` action for `StackRouter` focus the given `routeName` if it already exists in `StackRouter` state, rather than the current behavior of pushing it. If it does not exist in the state but the `StackRouter` handles the route, then it will push it. + +In other words, this proposed change is the same as how `StackRouter` behaves if you specify a `key` to the `navigate` action but without requiring that the user specify a `key` to take advantage of the behavior. If no `key` is provided, `StackRouter` assumes the user just wants to either jump to the route by the given name if it exists in state already or push it if not. + +# Basic example + +In the "Moving between screens" section of the documentation, we have the following example: + +``` +class DetailsScreen extends React.Component { + render() { + return ( + + Details Screen +