You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We encountered a crash in FlashList v2 (flashlist@2.x.x) that causes a maximum update depth exceeded error. This issue does not occur in FlashList v1, making it a regression.
error : "Render Error
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate."
✅ Expected Behavior
FlashList should avoid triggering an infinite re-render loop when modifying layout or handling orientation changes.
🔄 Actual Behavior
FlashList v2 causes setRenderId to continuously update, triggering an infinite loop and crashing the app.
🔙 Regression
✅ Yes — this issue does not happen in v1, so it is a regression in v2.
✍️ Additional Notes
We tried using extraData and forcing keys to re-render, but it did not prevent the crash.
This may be linked to how modifyChildrenLayout() internally triggers updates.
Reacted by siddhant-rl, Georgi Ivanov, zfurtak and Jeffery Jackson, Jr.
@naqvitalha data={listData.filter(f => !!f)} or data={listData.slice()} fixes the crash ,data={[...listData])} fixes the crash , does this make any sense
Some more details or a repro will be helpful. This issue only happens when there's something wrong with list setup like duplicate keys in keyExtractor or having a list inside a ScrollView causing all items to render at one. If it's neither then I can look into it.
Hi @naqvitalha ,
I've verified that the keyExtractor is not generating any duplicate keys. The crash still occurs even when renderItem={null} or when the render component is not being used.
I'd appreciate a repro for this or some more details. A video might help too. We do render in a loop but it's always supposed to end unless your items keep changing their size or you're rendering too many to begin with (hundreds).
There can be some bug but since I don't have a repro, I can't do much. We also changed how we mount in alpha.21 so if this is happening on mount, you can try the new version.
In my app (with more complexe components, that works with v1), there is no Maximum update depth exceeded if i provide a ListHeaderComponent and/or ListFooterComponent in the horizontal nested list, but I experienced an other issue (that I can't repro in a snack) :
@naqvitalha Thank you! I tested it and still experience the Maximum update depth exceeded if I remove ListHeaderComponent and ListFooterComponent from the horizontalList.
I observed something else : If I set a style={{width, height}} to the horizontalList (based on my previous estimatedListSize), even without ListHeaderComponent and ListFooterComponent, there is no Maximum update depth exceeded.
But in all cases where there is no Maximum update depth exceeded, I still experience an [UIView(ComponentViewProtocol) updateLayoutMetrics:oldLayoutMetrics:]: Received invalid layout metrics with graphic glitch rendering. (but maybe that's an other issue)
@Freddy03h It makes sense why adding header or size fixes it. We render lazily and not having size increases the number of setState calls we need to make. With header being there, we have a size to work with.
My fix significantly reduces the number of calls needed. It fixed the sample you provided: https://snack.expo.dev/@naqvitalha/flashlist-horizontal-bug-repro
Do you have a huge number of items rendering on mount (vertical list children + horizontal list children)? Can you provide another repro and a screen shot of what you're trying to render?
I rework my component for the horizontal list (it was flexible because it is supposed to work on a grid, but with the removed fixed container size, it was trapped in a render loop and caused glitches).
Hi @Freddy03h@naqvitalha
My issue with the infinite render loop error and crash while opening the FlashList component was fixed in v2.0.4-alpha.1. However, I am now facing a similar issue when scrolling the list.
@Prajwaltechversant I'd really appreciate if you can create a repro on expo snack. I will take a look. We've shipped v2.1.0 with all the fixes made so far.
Activity
Prajwaltechversant commentedon Jul 14, 2025
@naqvitalha i got this crash both in debug and release. in v1 works fine without this crash
Prajwaltechversant commentedon Jul 14, 2025
@naqvitalha i also tried this in flatlist, works fine there
Prajwaltechversant commentedon Jul 14, 2025
@naqvitalha data={listData.filter(f => !!f)} or data={listData.slice()} fixes the crash ,data={[...listData])} fixes the crash , does this make any sense
tsdevshop commentedon Jul 14, 2025
Issue appears to be coming from this line, which is setting state inside a useLayoutEffect with no deps. As a result, the state is set, component re-renders, which fires the
useLayoutEffect, which sets the state, which re-renders the component... etc.Perhaps we need a way to short-circuit this if the layout measurements aren't stable?
naqvitalha commentedon Jul 14, 2025
Some more details or a repro will be helpful. This issue only happens when there's something wrong with list setup like duplicate keys in
keyExtractoror having a list inside a ScrollView causing all items to render at one. If it's neither then I can look into it.Prajwaltechversant commentedon Jul 15, 2025
Hi @naqvitalha ,
I've verified that the keyExtractor is not generating any duplicate keys. The crash still occurs even when renderItem={null} or when the render component is not being used.
AjayFrancisTechversant commentedon Jul 15, 2025
@naqvitalha , any updates on this?
naqvitalha commentedon Jul 15, 2025
I'd appreciate a repro for this or some more details. A video might help too. We do render in a loop but it's always supposed to end unless your items keep changing their size or you're rendering too many to begin with (hundreds).
There can be some bug but since I don't have a repro, I can't do much. We also changed how we mount in alpha.21 so if this is happening on mount, you can try the new version.
Prajwaltechversant commentedon Jul 16, 2025
HI @naqvitalha ,
I'll check that in the alpha version. Do you have an estimated timeline for the RC (release candidate) version?
Prajwaltechversant commentedon Jul 16, 2025
Hi @naqvitalha , works fine in alpha release
Gothamoo7 commentedon Jul 16, 2025
@Prajwaltechversant @naqvitalha I'm getting the same issue in alpha.21 as well, if the list has more than 50 items.
Any workaround?
Prajwaltechversant commentedon Jul 16, 2025
HI @Gothamoo7 , for me , the rendering issues is fixed in alpha 21.
Prajwaltechversant commentedon Jul 16, 2025
@Gothamoo7 data={listData.filter(f => !!f)} or data={listData.slice()} fixes the crash ,data={[...listData])} fixes the crash , try this
naqvitalha commentedon Jul 16, 2025
@Gothamoo7 Can you provide a repro (on expo snack) ? 50 items shouldn't cause this.
11 remaining items
Freddy03h commentedon Aug 29, 2025
Hi, I experienced same issue while upgrading to v2, with horizontal list nested in vertical list.
I reproduced the issue here : https://snack.expo.dev/@freddy03h/flashlist-horizontal-bug-repro
I observed that if you provide a
ListHeaderComponentin the nested horizontal list, there is noMaximum update depth exceededIn my app (with more complexe components, that works with v1), there is no
Maximum update depth exceededif i provide aListHeaderComponentand/orListFooterComponentin the horizontal nested list, but I experienced an other issue (that I can't repro in a snack) :I don't know if it can help 😅
react-native@0.80.2
VladosK0k0s commentedon Sep 3, 2025
Fixed this by wrapping array with useMemo
data={[...pastSessions, ...futureSessions, 'offset' ]}=>Freddy03h commentedon Sep 4, 2025
In my example, data is created outside func cmp, so there is no render because of data changes.
Prajwaltechversant commentedon Sep 8, 2025
Hi @naqvitalha
I’m still running into the same crash even when using:
flash-list@2.0.3
The behavior looks identical to the original issue — FlashList enters a render loop and React throws Maximum update depth exceeded.
Steps I’ve tried to rule out usage issues:
Verified data and renderItem are memoized/stable
Environment:
React Native:0.80.2
FlashList: 2.0.3, 2.0.2, 2.0.0
Platform: Both
naqvitalha commentedon Sep 9, 2025
@Freddy03h I'm looking into the repro you provided. If anyone else has another one, please share.
naqvitalha commentedon Sep 10, 2025
@Freddy03h I've put up a PR with a fix: #1899. You check test the fix in
v2.0.4-alpha.1Freddy03h commentedon Sep 11, 2025
@naqvitalha Thank you! I tested it and still experience the
Maximum update depth exceededif I removeListHeaderComponentandListFooterComponentfrom the horizontalList.I observed something else : If I set a
style={{width, height}}to the horizontalList (based on my previousestimatedListSize), even withoutListHeaderComponentandListFooterComponent, there is noMaximum update depth exceeded.But in all cases where there is no
Maximum update depth exceeded, I still experience an[UIView(ComponentViewProtocol) updateLayoutMetrics:oldLayoutMetrics:]: Received invalid layout metricswith graphic glitch rendering. (but maybe that's an other issue)naqvitalha commentedon Sep 11, 2025
@Freddy03h It makes sense why adding header or size fixes it. We render lazily and not having size increases the number of setState calls we need to make. With header being there, we have a size to work with.
My fix significantly reduces the number of calls needed. It fixed the sample you provided: https://snack.expo.dev/@naqvitalha/flashlist-horizontal-bug-repro
Do you have a huge number of items rendering on mount (vertical list children + horizontal list children)? Can you provide another repro and a screen shot of what you're trying to render?
Freddy03h commentedon Sep 18, 2025
Hi! Sorry for the delay!
I rework my component for the horizontal list (it was flexible because it is supposed to work on a grid, but with the removed fixed container size, it was trapped in a render loop and caused glitches).
So for me, it's ok with this issue 👍
Maybe other people here @Prajwaltechversant @manastelavane @varungandhi121 @VladosK0k0s @Gothamoo7 can test and confirm the fix on the
v2.0.4-alpha.1?Prajwaltechversant commentedon Sep 19, 2025
Hi @Freddy03h @naqvitalha
My issue with the infinite render loop error and crash while opening the FlashList component was fixed in v2.0.4-alpha.1. However, I am now facing a similar issue when scrolling the list.
naqvitalha commentedon Sep 25, 2025
@Prajwaltechversant I'd really appreciate if you can create a repro on expo snack. I will take a look. We've shipped v2.1.0 with all the fixes made so far.
weizhe412 commentedon Sep 26, 2025
Also found this issue on my project and 2.1.0 still did not work
I added a fixed width on style and solved it (worked at least on 2.0.2)
naqvitalha commentedon Oct 14, 2025
Hey folks, I'll be closing this issue since it's not actionable. If anyone still has a problem please open a new one with a repro.