question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lazy load nested stack navigator

See original GitHub issue

Describe the bug In my app i have multiple stack navigators, when i try to use register on the stack it doesnt work, but when i do it on screens separately it works.

Code snippet

import { FTUEStack } from './FTUEStack';

const AppNavigator = createSwitchNavigator({
    FTUE: {
      screen: FTUEStack
    }
)

changing it to (doesn’t work):

import { register } from 'react-native-bundle-splitter';

const AppNavigator = createSwitchNavigator({
    FTUE: {
      screen: register({
           require: () => require('./FTUEStack'),
           name: "FTUE"
      })
    }
)

i preload the component and then navigate, i have no errors but i dont have navigation.

Thank you for your help !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
MaxToybermancommented, Feb 27, 2021

Thanks @kirillzyusko for the explanation ! I think moving to react navigation 5 will be a good option although we have a big project.

1reaction
MaxToybermancommented, Feb 25, 2021

Hi @kirillzyusko

created a new sample app, this time i have an error “no routes in navigation state”. i agree that it is made for screens, but loading a whole stack can save a lot of time.

here is a link.

https://github.com/MaxToyberman/bundleSplitterExample

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preload nested stack in react-navigation 5.x tab - Stack Overflow
I am using the lazy prop of createBottomTabNavigator which doesn't seem to have any effect: <Tab.Navigator lazy={false}> ... Triggering a log in ...
Read more >
Nesting navigators - React Navigation
Stack navigators nested inside each screen of tab navigator - The tab bar is always visible. Usually pressing the tab again also pops...
Read more >
BigBinary Books - Using Nested Navigators
A Stack Navigator provides a way for your app to transition between screens where each new screen is placed on top of a...
Read more >
Angular Navigation: How Routing & Redirects Work in Angular ...
The simplest breakdown for what we have here is a path/component lookup. When our app loads, the router kicks things off by reading...
Read more >
Nested Navigation - StackBlitz
Editor Preview Both. Sign in. Project. Search. Settings. Switch to Light Theme. Enter Zen Mode. Project. Download Project. Info. Nested Navigation. Lazy ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found