-
Notifications
You must be signed in to change notification settings - Fork 102
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
Restructure code splitting — remove the quick flash white screen when switching pages #3099
Conversation
Quick Note:The big diff in the PR And the same applies to the So the diff comes from just moving the stuff around but on actual adding or deletion was done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/check
Background
We implemented lazy loading (aka code splitting) back then when Yoroi was taking so long in the initial loading screen when opening the extension.
The Problem
When switching between tabs/pages we have a quick white flash screen.
Root Cause
It happens because when switching to a new tab that you never visited before the page is not actually there what will happen is while loading this page we will show this blank white screen. This screen is shown because we only have one
Suspense
with a fallback ofnull
that wrapped the whole application (here)So whenever page or subpage is still loading we fallback to the blank white screen.
The Solution
Suspense
that wraps all pages we scope it into the level of subpagesLoadingScreen
Suspense
to the page content not the whole page