Skip to content

Commit d8747bb

Browse files
naqvitalhaclaude
andauthored
docs: Clarify inverted list migration in v2 guide (#1845)
Update the v2 migration guide to explicitly mention reversing the data array when migrating from inverted prop to maintainVisibleContentPosition for chat-like interfaces. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 0745ee3 commit d8747bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

documentation/docs/v2-migration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ overrideItemLayout={(layout, item) => {
7777

7878
### Step 4: Replace Inverted Lists
7979

80-
If you were using `inverted` prop (common in chat apps), replace it with `maintainVisibleContentPosition`:
80+
If you were using `inverted` prop (common in chat apps), replace it with `maintainVisibleContentPosition` and reverse your data array:
8181

8282
```diff
8383
// v1 - Inverted list for chat
@@ -90,7 +90,7 @@ If you were using `inverted` prop (common in chat apps), replace it with `mainta
9090

9191
// v2 - Use maintainVisibleContentPosition
9292
<FlashList
93-
data={messages}
93+
data={reversedMessages}
9494
renderItem={renderMessage}
9595
+ maintainVisibleContentPosition={{
9696
+ autoscrollToBottomThreshold: 0.2,

0 commit comments

Comments
 (0)