0

Suppose I have 4 tab screens. The tab is created with a custom footer component with layout concept and all the navigational screens are listed in the stack navigator route section and used goBack() method to navigate the previous screen. now For a situation, my navigation route as follows started with Home->Testimonial->offerings, then again from offerings->Testimonial->about here I stopped in this screen then pressed the back button with goBack() function. but this time goBack() routes me to about->testimonial->offerings->home. Like the unique screens are listed in stack navigators routes, not the duplicate screens.

I want to know is it an issue? if yes, then how can I manage it?

  • 1
    instead of navigation.navigate, try navigation.push. This guide might help https://stackoverflow.com/questions/51090135/react-navigation-v2-difference-between-navigation-push-and-navigation-navigate – Sameer Kumar Jain Sep 30 '20 at 05:16

1 Answers1

0

Use a unique key for your screen.

https://reactnavigation.org/docs/navigation-actions/

   navigation.navigate({
       name: 'offerings',
       key: 'offerings' + someUniqueId,
   })
Zahra Mirali
  • 535
  • 3
  • 10