Skip to content

Actions.pop() broken in v3.2.4  #428

@aguenther

Description

@aguenther

Actions.pop() seems to no longer send the user back to the last scene, instead it a) selects the scene which is defined before the currently selected and b) deletes the last scene in the list. When the first element is reached, the app crashes with "undefined is not an object (evaluating 'selected.hasOwnProperty')"

My main component:

export default class ExampleApp extends Component {

  render() {
    var sceneDefaults={
      hideNavBar: true
    };
    return (
      <Router>
        <Scene key="tabbar" initial={true} tabs={true} default="home" style={style.tabBar} >
          <Scene
            {...sceneDefaults}
            key="chat"
            title="Chat"
            icon={TabBarIcon}
            component={ChatScreen}
            inactiveImage={require('../image/chat.png')}
            activeImage={require('../image/active_chat.png')}
          />
          <Scene
            {...sceneDefaults}
            key="favorites"
            title="Favoriten"
            icon={TabBarIcon}
            component={FavoriteScreen}
            inactiveImage={require('../image/hotel.png')}
            activeImage={require('../image/active_hotel.png')}
          />
          <Scene
            {...sceneDefaults}
            key="home"
            title="Home"
            initial={true}
            icon={TabBarIcon}

            component={HomeScreen}
            inactiveImage={require('../image/home.png')}
            activeImage={require('../image/active_home.png')}
          />
          <Scene
            {...sceneDefaults}
            key="feedback"
            title="Feedback"
            inactiveImage={require('../image/book.png')}
            activeImage={require('../image/active_book.png')}
            icon={TabBarIcon}
            component={FeedbackScreen}
          />
          <Scene
            {...sceneDefaults}
            key="info"
            title="Info"
            icon={TabBarIcon}
            component={InfoScreen}
            inactiveImage={require('../image/info.png')}
            activeImage={require('../image/active_info.png')}
          />
        </Scene>
      </Router>
    );
  }
}

If "Home" selected, calling Actions.pop() causes the selection to pass to "Favorites", "Info" disappears. Next call moves the selection to "Chat", and removes "Feedback". The third call then causes the aforementioned javascript error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions