Hi fellow developers,
I am confused about structuring navigators in a React Native project using React Navigation and will appreciate it if someone can guide me about it.
In a recent project, I had to create a React Native app with multiple screens (30-35 screens approximately). I am using React Navigation for navigating between screens. I will appreciate some advice on what should one prefer between using a single stack navigator and all screens within that or should I use one main navigator and nested navigators within that for different sections of the app. Please also take into consideration that it is a bit complex navigation and I would have to often switch between nested navigators (i.e. move from screen A in navigator X to screen B in navigator Y and then move back). Considering the fact that a screen once mounted stays mounted (until we go back from it to the previous one, this is what I know, it would be awesome if you can explain in detail how this works) in React Navigation, what should one prefer to improve the performance of the app.
Please let me know if more explanation of the situation is required. I will appreciate advice on the pros and cons of one approach over the other.
I am still a fresher and will love to know how situations like these are handled in large scale projects.