Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dealing with no content being visible on the first cycle #986

Unanswered
hsjoberg asked this question in Q&A
Discussion options

Hi everyone.
As explained in the docs about onLoad(), in first cycle of FlashList no items will be seen. This is because the items will first figure out their height, before anything will be visible to the user.

 /**
 * This event is raised once the list has drawn items on the screen. It also reports @param elapsedTimeInMs which is the time it took to draw the items.
 * This is required because FlashList doesn't render items in the first cycle. Items are drawn after it measures itself at the end of first render.
 * If you're using ListEmptyComponent, this event is raised as soon as ListEmptyComponent is rendered.
 */
 onLoad?: (info: { elapsedTimeInMs: number }) => void;

This results in a visible flash of no content for brief time before the items arrive.
Previously I've used ScrollView in my app to handle content (yes, I do know this is very bad practice). In that case it would initially take longer to do a screen transition, but the content would then be there immediately, resulting in a nicer experience, in my opinion.

My question is: What are some common ways to deal with this flash of no content?

I figured that perhaps a loading indicator could be used, or as with the Shop app, "blank placeholder" graphics are used to wait in the rendering.
If these two things are the recommended practice, how would one go ahead and implement this in the best way?

Also, I'm testing with production build.

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

Did you manage to find any hints?

You must be logged in to vote
1 reply
Comment options

Unfortunately, no.

I suppose this is just the way things are.

Comment options

I'm also seeing this when the component with the flashlist comes back from a suspended state. Flow:
1 - Component with the FlashList is suspended and no FlashList is rendered but Fallback
2 - Promises resolved, FlashList renders no content on the first cycle, then renders the list, causing a jumpy effect.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /