-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
Description
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?
Reactions are currently unavailable