Lazy load bottom tabs#202
Merged
Merged
Conversation
…esetControllerGraph()
Closed
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
By default, an app with bottom tabs loads every tab's initial screen at startup — each tab's navigator immediately visits its start location, even for tabs the user may never open. For apps with several tabs, this means a burst of web view visits up front.
This PR adds an opt-in that defers each tab's initial load until the tab is first selected. The initially selected tab still loads right away; the others load the first time you tap into them, and stay loaded afterward. This spreads out the work and avoids paying for tabs that are never visited.
Eager loading remains the default, so existing apps are unaffected unless they opt in.
Public API changes
HotwireBottomNavigationControllergains a new optional constructor parameter,lazyLoadTabs: Boolean = false. Set it totrueto enable deferred tab loading:No other public APIs change, and the default (
false) preserves the current behavior.Notes
lazyLoadTabsto exercise the new behavior.