{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react-native/issues/2436","labels_url":"https://api.github.com/repos/facebook/react-native/issues/2436/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react-native/issues/2436/comments","events_url":"https://api.github.com/repos/facebook/react-native/issues/2436/events","html_url":"https://github.com/facebook/react-native/issues/2436","id":103097177,"number":2436,"title":"[RFC] Declarative navigator routeStack API","user":{"login":"tgriesser","id":154748,"avatar_url":"https://avatars.githubusercontent.com/u/154748?v=3","gravatar_id":"","url":"https://api.github.com/users/tgriesser","html_url":"https://github.com/tgriesser","followers_url":"https://api.github.com/users/tgriesser/followers","following_url":"https://api.github.com/users/tgriesser/following{/other_user}","gists_url":"https://api.github.com/users/tgriesser/gists{/gist_id}","starred_url":"https://api.github.com/users/tgriesser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tgriesser/subscriptions","organizations_url":"https://api.github.com/users/tgriesser/orgs","repos_url":"https://api.github.com/users/tgriesser/repos","events_url":"https://api.github.com/users/tgriesser/events{/privacy}","received_events_url":"https://api.github.com/users/tgriesser/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-08-25T19:22:19Z","updated_at":"2015-09-21T20:56:28Z","closed_at":null,"body":"The `Navigator` component stores quite a bit of information internally in `this.state`, which makes sense given the complexity of scene transitions. However, the imperative APIs needed to work with the `Navigator` component (`pop, push, replaceAtIndex`, etc.) are unfamiliar when coming from other traditionally declarative React core components.\r\n\r\nI'd like to propose adding a new (optional) declarative API:\r\n\r\n```js\r\n<Navigator routeStack={routes} />\r\n```\r\n\r\nThe `routeStack` prop would be an `Array` acting as both the `initialRouteStack` during `getInitialState` as well as diff'ed against the current `state.routeStack` in `componentWillReceiveProps`. When the `routeStack` entries differ, the component would make its best guess at how to transition, mount/unmount scenes, etc. This would allow for more complex manipulation of a scene route stack outside of the component, while also simplifying the API surface area of the Navigator.\r\n\r\nIf this seems like a reasonable proposal, I'd be happy to take a shot at implementing - haven't explored enough to see if there are any blockers that would prevent this from being possible, I'd imagine there are some complexities with gestures, etc.\r\n\r\nI searched a bit for other issues and didn't happen upon any related tickets, but let me know if I missed one!"},"comment":{"url":"https://api.github.com/repos/facebook/react-native/issues/comments/142105992","html_url":"https://github.com/facebook/react-native/issues/2436#issuecomment-142105992","issue_url":"https://api.github.com/repos/facebook/react-native/issues/2436","id":142105992,"user":{"login":"danscan","id":1638987,"avatar_url":"https://avatars.githubusercontent.com/u/1638987?v=3","gravatar_id":"","url":"https://api.github.com/users/danscan","html_url":"https://github.com/danscan","followers_url":"https://api.github.com/users/danscan/followers","following_url":"https://api.github.com/users/danscan/following{/other_user}","gists_url":"https://api.github.com/users/danscan/gists{/gist_id}","starred_url":"https://api.github.com/users/danscan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danscan/subscriptions","organizations_url":"https://api.github.com/users/danscan/orgs","repos_url":"https://api.github.com/users/danscan/repos","events_url":"https://api.github.com/users/danscan/events{/privacy}","received_events_url":"https://api.github.com/users/danscan/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T20:56:28Z","updated_at":"2015-09-21T20:56:28Z","body":"@bleonard– this is a great post.  I'm doing something similar now for declarative navigation with multiple route histories, as our app's primary nav is a tab bar, and each tab has its own history.  "}}