React-native Update content of side-menu - react-native

I used react-native-navigation drawer. I have a sidemenu that displays the name of the logged-in user. Now I want this name changed whenever the user updates his profile. I really dont know how to go about this. On the profile page I imported the Sidemenu like below
import SideMenu from './SideMenu';
and I did
new SideMenu().updateState("new name");
UpdateState(name) is a method in sideMenu that sets state that displays name. Name is not getting changed

Related

how to fix, blank page when trying to use history push in react native

I am working on a APP, where I created a button that navigates you to other page. I imported react native router and use history from react-router dom.
I created seperated folder with login routs (when user is on login screen he can move to sign-up)
Loginrouts.js :
than I created login.js where the button is, it uses useHistory.push() and it calls signup from loginroute.js
But when button is pressed it only shows blank screen, anyone knows why?

Navigating in the same scene with different props

I'm learning react-native with redux and I'm trying to make a kind of social network application.
My problem is: when I'm on a user-1 profile screen and I navigate to user-2 profile, so basically I navigate from Profile.js to Profile.js (same screen) with different props. The problem is when I press the 'back' button, I get the user-2 profile while I should see user-1 profile.
The profile informations are saved in the store with redux.
For navigation I use Actions.sceneKey() from react-native-router-flux.
I already tried :
this.props.navigation.navigate('profile', { key: someRandomKey });
I get "Promise returned from navigate is ignored".
T also tried to save every user profile informations that I visit in an array but I don't know how to manipulate this array when I press back button...

Data from Redux Store doesn't reset after change Screen Component

I have a problem with reset redux store data. I have Register component when I click signup button then I get errors and record them in store, then I draw under the inputs.
Now, if I back to Login screen and then go back again to Register screen the errors still shown but I don't want to see them.
How I can solve this problem? I understand that I need to set initial state every time when I go to a screen. I tried to set initial state to createStore but it doesn't work. Also I use Redux Observable's Epics.

How to update the StackNavigator (add screens) after auth

I am working on a application which have two types of users, user and admin, I want to import only those screens which are related to userType after authentication, for now I am importing all screens but I want to do it in this way, import only login screen on stack-navigator and after authentication push the screens related to the userType.

Dynamically adding tabs in react native app

I am creating an app in which the user selects certain regions from dropdown and i want to create tabs for each selected region dynamically.
I end up using react-native-tab-view and managed to implement dynamic tab navigation.
On our app we have group permissions so if the user is an admin on group he can see the megaphone the first tab and if he is not an admin he can't see.
group side navigation
Tab navigation if the user is admin
Tab navigation if the user is not an admin