Shopify / Shopify/flash-list

Why don't we have a LoadingComponent to show loading view?

Open
#1,979 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
7.2k
Forks
393
Avg merge
1d 3h
Merged PRs (30d)
1

Description

Problem Statement

Loading a list can take a while to get the data, usualy we would show some loading view like a skeleton view, but right now the only ways I see to do so are the following:

  • use ListEmptyComponent with loading state, which is not ideal and leads to many bugs.
  • use renderItem which is even more awkward and complicated to manage
  • conditionally render either the FlashList or the Loading view, which is not bad, but also leads to visual glitches and bugs

Proposed Solution

Introduce a new property LoadingComponent that gets renderd based on a given isLoading property

Example Usage
<FlashList
    data={displayData}
    isLoading={isFetchingData}
    LoadingComponent={<SomeLoadingSkeleton/>}
/>

Priority

  • Critical - Blocking my project
  • High - Significant improvement to my workflow
  • Medium - Would be nice to have
  • Low - Minor enhancement

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing FlashList's existing ListEmptyComponent and renderItem handling, then inspect how component properties and loading state would fit the current rendering flow. The change is complete when a new LoadingComponent can be shown according to isLoading without requiring conditional FlashList rendering or repurposing the empty state, with the example usage working as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.