facebook / facebook/relay

Issue with Concurrent Mode on FlatList

Open
#3,812 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Hi there! Is there any way to disable the concurrent mode?

I was using a FlatList inside a ScrollView like this:

```

...



```

As I experienced issues with `ondEndReached` (it’s being called every time) I moved to something like this:

```

```

That works properly (`onEndReached` is called when it has to), but as I have to use the Suspense to add a Spinner/Loader, if I wrap the `FlatList` in the `Suspense` it will suspend all the component (including the Header) and not only the items.

Do you have any idea about how to advance? One alternative is to make work the FlatList inside the ScrollVie, the other is to make it work the Suspense only for the items from the FlatList, and the last one is to disable the concurrent mode and use a boolean var to check if the data is being fetched.

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the FlatList inside ScrollView and the FlatList wrapped in Suspense, focusing on repeated onEndReached calls and suspension of ListHeaderComponent. Evaluate the three proposed directions in the issue and define done as a confirmed, project-supported resolution for the loading and header behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, react-native
Domain
frontend, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.