Skip to content

NavigationExperimental Modal Transition #9433

Description

@Quaggie

I've been experimenting NavigationExperimental with my team and we've run into a little transition problem.
Most of the code is taken from the example, which is why more questions were brought.
We expected the direction of the transition of the modal would pop out the same direction it was pushed in, but it doesn't.

Here's the gif with the occuring transition error:

Our code

// This is our root component, which is later rendered inside the <Provider /> and has the state and actions connected
const Root = ({navigationState, navigatePop}) => {

  const renderScene = ({scene}) => {
    const { route } = scene

        switch(route.key) {
        case 'First':
            return <First />
        case 'Second':
            return <Second />
      case 'Third':
            return <Third />
        case 'Modal':
            return <Modal />
        }
  };

  return (
            <NavigationCardStack
                navigationState={navigationState}
                onNavigateBack={navigatePop}
                style={styles.container}
                direction={navigationState.routes[navigationState.index].key === 'Modal' ? 'vertical' : 'horizontal' }
                renderOverlay={props => (
                    <NavigationHeader
                        {...props}
                        onNavigateBack={navigatePop}
                        renderTitleComponent={props => {
                            const title = props.scene.route.title
                            return <NavigationHeader.Title>{title}</NavigationHeader.Title>
                        }}
                    />
                )}
                renderScene={renderScene}
            />
        )
};

Project specification

  • Versions
    • react-native-cli: 1.0.0
    • react-native: 0.31.0
  • Current OS:
    • Mac
  • Tested on
    • Android & iOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions