Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

react native load app only if user is logged in calling AppRegistry.registerComponent multiple times

$
0
0

i have a user protected app, i want to authenticate user before loading the main app. so i was wondering is it possible to register more than one app and switch between them in runtime ?

for example i can have 3 apps 1. for login, 2. for admins, 3. for users

i register the three, and then run one of them based on condition,

AppRegistry.registerComponent('LoginApp',()=><LoginApp />);
AppRegistry.registerComponent('AdminApp',()=><AdminApp />);
AppRegistry.registerComponent('UserApp',()=><UserApp />);

i can see on https://facebook.github.io/react-native/docs/appregistry.html doc page many functions that seem useful, yet there is no documentation on how to use any of these functions :(

runApplication,unmountApplicationComponentAtRootTag seem like they can do what i want but how to implement this ?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>