{"action":"closed","issue":{"url":"https://api.github.com/repos/aksonov/react-native-router-flux/issues/1025","repository_url":"https://api.github.com/repos/aksonov/react-native-router-flux","labels_url":"https://api.github.com/repos/aksonov/react-native-router-flux/issues/1025/labels{/name}","comments_url":"https://api.github.com/repos/aksonov/react-native-router-flux/issues/1025/comments","events_url":"https://api.github.com/repos/aksonov/react-native-router-flux/issues/1025/events","html_url":"https://github.com/aksonov/react-native-router-flux/issues/1025","id":169643821,"number":1025,"title":"[Help wanted] Keep routing state on simulator reload","user":{"login":"ospfranco","id":1634213,"avatar_url":"https://avatars.githubusercontent.com/u/1634213?v=3","gravatar_id":"","url":"https://api.github.com/users/ospfranco","html_url":"https://github.com/ospfranco","followers_url":"https://api.github.com/users/ospfranco/followers","following_url":"https://api.github.com/users/ospfranco/following{/other_user}","gists_url":"https://api.github.com/users/ospfranco/gists{/gist_id}","starred_url":"https://api.github.com/users/ospfranco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ospfranco/subscriptions","organizations_url":"https://api.github.com/users/ospfranco/orgs","repos_url":"https://api.github.com/users/ospfranco/repos","events_url":"https://api.github.com/users/ospfranco/events{/privacy}","received_events_url":"https://api.github.com/users/ospfranco/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-05T16:19:57Z","updated_at":"2016-08-05T18:33:20Z","closed_at":"2016-08-05T18:33:20Z","body":"### Version\r\nTell us which versions you are using: \r\n\r\n- react-native-router-flux v3.31.0\r\n- react-native v0.29.0\r\n\r\n### Expected behaviour\r\n\r\nI have a scene structure based on tabs:\r\n\r\nRoutes.js\r\n```\r\nclass Routes extends Component {\r\n\r\n  render() {\r\n\r\n    function selector(props) {\r\n      return props.auth.isLoggedIn ? (props.auth.isVerified? 'home': 'authenticate') : 'authenticate'\r\n    }\r\n\r\n    const component = connect(state => ({\r\n      auth: state.auth,\r\n    }))(Switch)\r\n\r\n    return (\r\n      <AppRouter>\r\n        <Scene key=\"root\" component={component} tabs selector={selector} hideNavBar hideTabBar>\r\n          <Scene key=\"authenticate\" hideTabBar>\r\n            <Scene type=\"replace\" key=\"login\" initial component={GradientBackground(LoginScreen)} hideNavBar/>\r\n            <Scene type=\"replace\" key=\"register\" component={GradientBackground(RegisterScreen)} hideNavBar/>\r\n            <Scene type=\"replace\" key=\"forgotPassword\" component={GradientBackground(ForgotPasswordScreen)} hideNavBar/>\r\n            <Scene type=\"replace\" key=\"emailConfirmation\" component={GradientBackground(EmailConfirmationScreen)} hideNavBar/>\r\n          </Scene>\r\n          <Scene key=\"home\" component={NavigationDrawer} type=\"replace\">\r\n            {require('./scenes/home')}\r\n          </Scene>\r\n        </Scene>\r\n      </AppRouter>\r\n    )\r\n  }\r\n}\r\n```\r\n\r\nhome.js\r\n```\r\nmodule.exports = (\r\n  <Scene key=\"isLoggedIn\" unmountScenes initial>\r\n    {require('./dashboard.js')}\r\n    {require('./profile.js')}\r\n    {require('./challenges.js')}\r\n    {require('./friends.js')}\r\n  </Scene>\r\n)\r\n```\r\n\r\nDashboard.js\r\n```\r\nmodule.exports = (\r\n  <Scene type=\"replace\" key=\"dashboard\" initial navigationBarStyle={styles.transparent} drawerImage={Images.menu} renderRightButton={() => <RoundedButton text=\"dashboard\"/>}>\r\n    <Scene key=\"dashboard_home\" component={GradientBackground(DashboardScreen)}/>\r\n  </Scene>\r\n)\r\n```\r\n\r\nFriends.js\r\n```\r\nmodule.exports = (\r\n  <Scene key=\"friends\" initial navigationBarStyle={styles.transparent} drawerImage={Images.menu} renderRightButton={() => <RoundedButton text=\"dashboard\"/>}>\r\n    <Scene key=\"inviteFriends\" component={GradientBackground(FriendsInviteScreen)} hideNavBar/>\r\n  </Scene>\r\n)\r\n```\r\n\r\nwhen navigating through the app everything works fine.\r\n\r\n### Actual behaviour\r\n\r\nWhen I hit reload (or Cmd+R), the current shown scene, ex. a profile screen, get's reset to another completely different scene.\r\n\r\nEx. currently the logic in my app goes like this:\r\n\r\nfirst time user logs in -> show friend invitation screen -> go to dashboard page\r\nevery other log in -> go to dashboard page\r\n\r\nhowever whenever I hit Cmd+R I always get sent to friend invitation screen, needless to say, this is very annoying and time consuming.\r\n\r\n### Steps to reproduce\r\n\r\n1. open a scene\r\n2. hit Cmd+R\r\n3. other scene will be shown\r\n\r\n\r\n"}}
{"actor":{"display_login":"ospfranco"}}