Skip to content

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

@ajakka

Description

@ajakka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions