NavigationExperimental Modal Transition
See original GitHub issueI’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
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:9 (6 by maintainers)
Top Results From Across the Web
Modal Transition - Build an Animated App with Rive and SwiftUI
This is a compilation of the SwiftUI live streams hosted by Meng. Over there he talks and teaches how to use design systems,...
Read more >Learning Multi-Modal Navigation in Unstructured Environments
A robot that operates efficiently in a team with humans in an unstructured outdoor environment must translate commands into actions from a ...
Read more >Navigation API - MDN Web Docs - Mozilla
Note: In this context "transition" refers to the transition between one history entry and another. It isn't related to CSS transitions.
Read more >Modal Testing: A Practical Guide - Siemens Communities
This article explains some of the key steps involved in performing a modal test, from start to end. In an experimental modal, a...
Read more >Better modals in React Native - Brains & Beards
I've been working recently with modal popups in React Native (again!) and realised it's a recurring ... Display with a navigation transition.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Hitabis Looks something like this
@hedgerwang, maybe we should consider removing the ‘direction’ prop. It is working as intended but is not meeting people’s needs.
Instead, I think we should consider introducing
NavigationModalStack
for vertical transitions, andNavigationCardStack
can always be horizontal.cc @skevy