Justin Priede
Justin Priede

Reputation: 119

Navigation container disappears after splash screen

I implemented a splash screen last night and this morning I noticed it was taking away my bottom tab navigator. I recreated the problem here

In the snack, originally you will see the bottom tab navigator. If you go into App.js and uncomment the call to the splashscreen, you will see what I am talking about.

Does anyone know how I could go about making sure this does not happen? The splash screen is a little extra in itself so if you guys think it would be best to scratch this one and go for something else I am open to suggestions!

Thank you for anything, I appreciate it more than you know.

Upvotes: 0

Views: 362

Answers (1)

nithinpp
nithinpp

Reputation: 2025

The reason you are not seeing the Bottom Tab is because you are not rendering that part of the app anymore. You were simply rendering the <Home/> component inside the SplashScreen, which is not really the bottom tab screen, but a screen that is part of the whole bottom tab.

To make it work, You can do the following,

inside App.js, export your MyTabs function.

export function MyTabs() {
 // all the previous stuff
}

Then import it inside SplashScreen like below,

import {MyTabs} from '../App' 

Now replace <Home></Home> with <MyTabs/>.

Here's the Snack

Not totally sure if this is a good practice, will have to dig up some docs, But will work for your use case.

Upvotes: 1

Related Questions