maxItemsInRecyclePool=0 does not disable recycling
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 392
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 1
Description
Description
According to the docs, setting maxItemsInRecyclePool to 0 should "disable the recycle pool and items will unmount once they are scrolled off the screen" - which I understand to mean that recycling is disabled entirely.
But that's not the case. Even with maxItemsInRecyclePool={0}, I can change the local state of an item, scroll down, and see the state attached to a different item.
Happy to be corrected if I've misunderstood what the docs mean, or I've misunderstood recycling :-)
Current behavior
I alter the state of Item 0. I then scroll down, and I see that state applied to item 14
https://github.com/user-attachments/assets/c32760bd-ab60-4b79-98b4-89b01c1b834e
Expected behavior
With maxItemsInRecyclePool={0} I expect recycling to be disabled, so the local state of an item which is scrolled out of view should be lost entirely rather than reapplied to another item.
Reproduction
Expo Snack or minimal reproduction link:
https://snack.expo.dev/@michaeldjay/flashlist-maxitemsinrecyclepool-bug
Have provided a snack for convenience. Have also tested in expo 57 (latest available right now) with flashlist version 2.0.2 (recommended by expo) and 2.3.2 (latest version.) Have tested on real android device and react native web. Same results however I test.
(Not able to test iOS)
Platform
- iOS
- Android
- Web (if applicable)
Environment
N/A (can't run npx react-native info in expo snack environment)
FlashList version: 2.0.2, 2.3.2
Additional context
Checklist
- I've searched existing issues and couldn't find a duplicate
- I've provided a minimal reproduction (Expo Snack preferred)
- I'm using the latest version of @shopify/flash-list
- I've included all required information above
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Expo Snack reproduction and the maxItemsInRecyclePool documentation, testing the behavior on the reported Android and Web platforms. Trace how the option is handled in FlashList versions 2.0.2 and 2.3.2, then add regression coverage showing that a value of 0 prevents recycled item state from appearing on another item.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100