maxItemsInRecyclePool=0 does not disable recycling
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
Source: Shopify/flash-list