-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handling hybrid root apps (single / tab screen apps) #9
Comments
It's not a problem to have both. Based on your app state, you can call |
I see, I notice the redux example captures the idea. I'll take a closer look at how the redux example works. I'm not familiar with redux. I was leaning toward an environment that does not rely on redux for state management. I'll see what I can make out of dealing this hybrid root apps, particularly beyond redux. Thank you. |
It's actually very easy to implement without redux. On your app launch, usually in // post-login state
Navigation.startTabBasedApp({...}); Whenever you want to switch structure, you can simply call onLogoutButtonPress() {
// pre-login state
Navigation.startSingleScreenApp({...});
} |
@smooJitter I'm closing this, if you don't manage to get this working please reopen |
Hi all - I tried the above suggestions, but am having difficulty getting the calls to I'm using if (status.connected === false || loggingIn) {
return <LoadingScreen />;
} else if (user !== null) {
return <LoggedIn />;
} else {
return <LoggedOut />;
}
Navigation, however, seems to be ignoring this logic - and is loading the components automatically and in order once the respective module is imported (e.g., Load order (imports) is: import LoadingScreen from './components/LoadingScreen';
import LoggedOut from './layouts/LoggedOut';
import LoggedIn from './layouts/LoggedIn'; I thought this issue posting had answered my original question (which I also posted to StackExchange - will update answer there if I can figure this out), but then I ran into the above issues. Thanks much. |
I am also interested in hooking all this up with react-native-meteor. I setup a repo which tries to accomplish this, but I'm afraid I got a little stuck with how to properly setup the switch in the root. According to this thread, it seems that I should be able to load the app with startSingleScreenApp, and if the user is logged in, I can call Navigation.startTabBasedApp({...}); from within the logged in component and it will replace the root with the TabBasedApp. Is this approach correct or is there a better way to keep a redux store updated with current Meteor information? Thanks for any guidance in this. |
@swhamilton That's indeed the correct approach. Your redux store persists when you call |
@swhamilton, you may want to try: |
merge wix
Tab vs Single page App. I'm considering an app that's both single page (onboard login screen) and tab base. I can't figure out how to structure this. It seems that I ha e to choose one or the other. It doesn't appear that o could hide the tabbar
The text was updated successfully, but these errors were encountered: