Skip to content

Stacknavigator transition extremely slow #608

@natashache

Description

@natashache

Hi,

I use nested navigator structure and have noticed that the transition between some screens are very, very slow.

Here's the setup:

export const MainNavigator = TabNavigator({
  Search: { screen: Search},
  Explore: { screen: Explore },
  CourseNavigator: { screen: CourseNavigator },
  MyProfile: { screen: MyProfile }
}, {
  initialRouteName: 'CourseNavigator',
  navigationOptions: {
    tabBar: {
      visible: false
    },
    header: {
      visible: false
    }
  },
})

export const CourseNavigator = StackNavigator({
    MyCourses: { screen: MyCourses },
    PlayerNavigator: { screen: PlayerNavigator }
  }, {
  headerMode: 'screen'
})

export const PlayerNavigator = StackNavigator({
    CoursePage: { screen: CoursePage },
    Player: { screen: Player }
  }, {
    headerMode: 'screen',
    mode: 'modal'
})

So PlayerNavigator is nested under CourseNavigator, which is under MainNavigator.

What's moving very slow is the transition between the Mycourses screen in CourseNavigator and the CoursePage screen in PlayerNavigator. It takes two full seconds for the screen to change.

The code for the transitioning is very straightforward:

  goToCourse(course) {
    const {navigate} = this.props.navigation
    navigate('PlayerNavigator')
    this.props.setCurrentCourse(course)
  }

// And then in the render function...

        <Button transparent small
          onPress={ () => this.goToCourse(course) }>
          <Icon name='ios-arrow-forward' />
        </Button>

Wondering if anybody has experienced similar slowness and what could be the potential cause?

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions