Force React Navigation go back without re-rendering - reactjs

I am using DrawerNavigator from react-navigation with Redux for my React Native app (using Expo). My Home screen contains a map (using react-native-maps). From Home screen, I navigate to a new screen.
Whenever I click the Back button in this new screen to go back to Home screen: dispatch(NavigationActions.back(), the Home screen always re-render. Is there any way to go back without re-rendering my Home screen and keep all the states and props unchanged?

This is an open issue I think. Try using a stacknavigator inside the drawernavigator instead.

Related

How to import navigation in WebView component?

i stuck with one case in React Native. I have this components:
This is my App file..where my set i want to start with WebViewScreen, i still did not set useState etc.
My Navigation component:
And my WebView component:
So i have one question. How i can use navigation in WebViewScreen, when this component is outside of NavigationContainer. Some people will tell to import WebViewScreen as Stack.Screen .. okey but in my site where i have inputs and after click keyboard should up on Android when i click input keyboard up, refresh and hide..I need to use navigation, because with changeNavigationState i want to handle when user click on Login button, to redirect to my Native Login Screen. Thanks in advance :)
Theres is NO way you can use any navigation method from react-native-navigation outside of their own provider (NavigationProvider). If you want to use navigation on your WebviewScreen, you HAVE TO place it in a stack screen. Besides from that, anything else would be BAD PRACTICE. If this answer is not enough pls explain why you can't place the WebviewScreen in your NavigationContainer cause this is the real problem then.

React : How to retain state of the previous page while navigating from one screen to other

I'm new to react and react router. Previously I was working on react-native and react navigation. In react navigation, if I navigate from screen 1 to screen 2 and then come back to screen 1, the state of screen 1 was retained as it was. But how do I get the same result using react and react-router
My specific requiement is if an accrodian is opened in screen 1 and I navigate to screen 2 and then comeback to screen 1, I want the accordian to be still open. i.e, state of the page should be retained. How to achive this using react and react-router-dom

React Navigation - Common component across screens in DrawerNavigator

in my app I have a drawer which contains some screens. In each screen there's a common component, let's call it Footer:
For more details, let's take a look at the design of my app:
- The drawer
("Transactions", "Statistics", "Settings" ... are stack navigators)
- The Transactions screen
I tried these approaches:
- Put the Footer component in the same level with the drawer. There's a problem doing this: when the drawer is opened, it's behind the Footer
- Add the Footer component in every screen. This isn't an elegant solution because multiple Footer component will be created, and I have to create a redux state to synchronize these instances of this component.
Note: I'm using react-native version 0.44 and react-navigation version 1.5.2

react navigation sidebar close issue when quickly click menu

I'm using react navigation (sidebar) in react native project, but when I click quickly on sidebar menu sidebar doesn't close but background scene is changing. In this way I'm navigating to scene. Even the same issue found on kitchen sink app https://nativebase.io/kitchen-sink-app as the I'm following same.
this.props.navigation.navigate(route);

Close screen / unmount screen

I am using react-navigation to navigate the screen in my react native app. I have one question, is it possible that when I close screen or unmount screen, the rendered content are kept and not destroyed. So the next time when I call the screen again, the rendered content should not be reloaded again. Or maybe there is another way to achieve this. Thanks a lot
You should try redux and get your states from your reducers.

Resources