React Native this.props.navigator.push can't push a component twice for Navigator
See original GitHub issueWhen I use a function like this:
driverCreateTrip: function(){
this.props.navigator.push({
title: "New Trip",
component: DriverCreateAccount,
});
},
, if I have already pushed the DriverCreateAccount component in a previous .js file, then it seems I can’t use the push again, does it mean I have to use pop to get back to where I want to go? I can’t push the same component twice to the stack?
Issue Analytics
- State:
- Created 8 years ago
- Comments:18 (3 by maintainers)
Top Results From Across the Web
React Native this.props.navigator.push can't push a component ...
Alpha and Beta don't need each other until the user navigates from one scene to the next. For the app to reach this...
Read more >React navigation prevent double push() - Stack Overflow
1. The app has multiple stack navigators. So there are a lots of navigation.push('Routename') calls. Trouble is when the control surface ( ...
Read more >Access the navigation prop from any component
useNavigation is a hook which gives access to the navigation object. It's useful when you cannot pass the navigation prop into the component...
Read more >react-router v6 demystified (part 2) - DEV Community
The solution is to store the location in a state and change it when we navigate through the pages. But we can't just...
Read more >Handling Mounting And Unmounting Of Navigation Routes In ...
Custom components in React Native (how to create components, receive, pass, and use props in a component). Read more. React Navigation.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
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
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
@hedgerwang so it works if I push a component that hasn’t been pushed before, but if I push something already on the stack then it gives me this error
+1, this solution rocks. Thanks @ericvicenti and @kevinzzz007