{"action":"created","issue":{"url":"https://api.github.com/repos/react-navigation/react-navigation/issues/3920","repository_url":"https://api.github.com/repos/react-navigation/react-navigation","labels_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/3920/labels{/name}","comments_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/3920/comments","events_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/3920/events","html_url":"https://github.com/react-navigation/react-navigation/issues/3920","id":311886701,"number":3920,"title":"Access current route stack","user":{"login":"clementino36","id":6041593,"avatar_url":"https://avatars1.githubusercontent.com/u/6041593?v=4","gravatar_id":"","url":"https://api.github.com/users/clementino36","html_url":"https://github.com/clementino36","followers_url":"https://api.github.com/users/clementino36/followers","following_url":"https://api.github.com/users/clementino36/following{/other_user}","gists_url":"https://api.github.com/users/clementino36/gists{/gist_id}","starred_url":"https://api.github.com/users/clementino36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clementino36/subscriptions","organizations_url":"https://api.github.com/users/clementino36/orgs","repos_url":"https://api.github.com/users/clementino36/repos","events_url":"https://api.github.com/users/clementino36/events{/privacy}","received_events_url":"https://api.github.com/users/clementino36/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-06T08:19:20Z","updated_at":"2018-04-12T09:09:00Z","closed_at":null,"author_association":"NONE","body":"### Current Behavior\r\n\r\n`componentWillUnmount` is not fired while navigating between routes. This means that the more I navigate between screens, the more components are being mounted (even if I've been through these components in the stack earlier). After a while, the app becomes **really** slow because two many components are mounted at the same time (or at least that's how I understand it).\r\n\r\n### Expected Behavior\r\n\r\nI would expect to be able to manipulate the stack in order to, for example, remove the first route when a determined number of routes are stacked, so there would be a \"max number\" of components mounted at the same time.\r\nIs there any way of accessing the complete current stack (not only the current route via `navigation.state`) ? Or even logging it ? If so, how can I remove routes at a certain index ?\r\nRight now i'm resetting the stack via `NavigationActions.reset` on a particular screen, which is not op at all."},"comment":{"url":"https://api.github.com/repos/react-navigation/react-navigation/issues/comments/380733128","html_url":"https://github.com/react-navigation/react-navigation/issues/3920#issuecomment-380733128","issue_url":"https://api.github.com/repos/react-navigation/react-navigation/issues/3920","id":380733128,"user":{"login":"clementino36","id":6041593,"avatar_url":"https://avatars1.githubusercontent.com/u/6041593?v=4","gravatar_id":"","url":"https://api.github.com/users/clementino36","html_url":"https://github.com/clementino36","followers_url":"https://api.github.com/users/clementino36/followers","following_url":"https://api.github.com/users/clementino36/following{/other_user}","gists_url":"https://api.github.com/users/clementino36/gists{/gist_id}","starred_url":"https://api.github.com/users/clementino36/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clementino36/subscriptions","organizations_url":"https://api.github.com/users/clementino36/orgs","repos_url":"https://api.github.com/users/clementino36/repos","events_url":"https://api.github.com/users/clementino36/events{/privacy}","received_events_url":"https://api.github.com/users/clementino36/received_events","type":"User","site_admin":false},"created_at":"2018-04-12T09:09:00Z","updated_at":"2018-04-12T09:09:00Z","author_association":"NONE","body":"Since a new route was pushed every time I used `navigate`, the number of components mounted at the same time could get really big. \r\nI saw that it is now possible to specify a key when navigating to a screen and use the same key to navigate back to it, so a new component would not be mounted.\r\n`this.props.navigation.navigate( { routeName: 'homeRoute', key: 'homeKey' } );`\r\nThis really improved the performance of my app, but the question still resides: when are the components unmounted ? How can I truly get hands on the stack to be able to remove some items ?"}}
{"actor":{"display_login":"clementino36"}}