how to set initial route screens in stacknaviagtor React native? - react-native

If user already loggedin for app,the initial screen should be home screen with stack navigator. How is it possible?

in case you are using React Navigation in your app, there is a complete flow right here:
https://reactnavigation.org/docs/en/auth-flow.html
i think you have to change some part of it due to using redux. hope it helps :)

Related

Pass data from profile screen to custom navigation drawer

I am displaying profile pic and username in my app drawer. But drawer updating when I restart the app again. I am new to react native so I don't know how to refresh my drawer after changing profile pic in my profile screen. I searched about it and found it can be done by redux, but I am not getting any proper code to do that.
Have a try by saving the userData in the Redux and get the userData from the redux in the Drawer Component so whenever data changes it will be reflected the Component where it is being used.
check out the official docs for redux.
https://react-redux.js.org

React Native - Disable certain navigation in TabNavigator

Fairly new and learning React Native.
The project is created with Expo/React Native, I wonder if it is possible to disable Links and Settings
I found this as a working solution. The idea is that by default every screen you put in your stackNavigator is added to this bar, so as you don't want to remove them from your stackNavigator, so you should do another trick. Hope it works for you.

Update Drawer Navigation using Redux in React Native

How to update the Drawer Navigation in a react native app based on a boolean in redux store. For example: I want the items in the drawer navigation to change once the user logs in. Is there a way to implement this in react native using redux ( using state is fine too ).
Thanks in advance!
You will have to create two navigation drawer instances. One for not logged in and the other for when the user is logged in and then use accordingly.

Drawer navigation in react navigation will not close until the next page appear

I don't know if I am the one getting it wrong. I am working on a project, I use react navigation, and I am using drawer and stack navigator. But when I click on any menu on the drawer 1. The drawer will remain open until the next page appear 2. The menu that I click will remain active until the next screen appear.
I try to check other application performance, they don't perform like that. Is that how react navigation works or am I the one getting it wrong?
Please help because I am new to react native and react navigation.
i came across a post on Fixing common performance problems in React Navigation
i just change the code in componentdidmount method like this
componentDidMount(){
InteractionManager.runAfterInteractions(() => {
// Component is done animating
// Start making any request
});
};
with that my problem is solved but i dont know if is the right way of doing it.

resetTo and immediatelyResetRouteStack action types in react-native-router-flux

After successfully login I want to reset my navigator to Home screen with a animation. This is very much possible with Navigator's resetTo method but I am using react-native-router-flux and this component do not have animation on reset action. Issue is already raised here.
I am looking for resetTo and immediatelyResetRouteStack functionalities in react-native-router-flux, if you have any solution to this let me know please. Thanks.