Skip to content

Commit 8ab19d2

Browse files
authored
docs: remove outdated inverted prop deprecation references (#2134)
The inverted prop is now supported in v2, so remove references that incorrectly mark it as deprecated in the v2 changes and migration docs.
1 parent 473022b commit 8ab19d2

2 files changed

Lines changed: 4 additions & 32 deletions

File tree

‎documentation/docs/v2-changes.md‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const GridItem = ({ item }) => {
119119
[item.id],
120120
() => {
121121
// runs on reset. Can be used to reset scroll positions of nested horizontal lists
122-
}
122+
},
123123
);
124124
const height = isExpanded ? 100 : 50;
125125

@@ -182,7 +182,6 @@ Read more [here.](./fundamentals/layout-commit-observer.md)
182182
- `estimatedItemSize`: No longer used.
183183
- `estimatedListSize`: No longer used.
184184
- `estimatedFirstItemOffset`: No longer used.
185-
- `inverted`: We have added `maintainVisibleContentPosition` support, so we don't want to maintain inverted mode.
186185
- `onBlankArea`: We don't have plans to add or continue supporting this prop.
187186
- `disableHorizontalListHeightMeasurement`: No longer needed.
188187
- `disableAutoLayout`: There's no auto layout in v2.

‎documentation/docs/v2-migration.md‎

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ This guide will help you migrate your existing FlashList v1 implementation to v2
1515
- **No more size estimates required** - FlashList v2 automatically handles all sizing
1616
- **Masonry layout is now a prop** - MasonryFlashList component is deprecated
1717
- **maintainVisibleContentPosition enabled by default** - Better scroll position handling
18-
- **Inverted prop deprecated** - Use maintainVisibleContentPosition instead
1918

2019
## Step-by-Step Migration
2120

@@ -49,7 +48,6 @@ The following props have been deprecated and should be removed from your FlashLi
4948
<FlashList
5049
data={data}
5150
renderItem={renderItem}
52-
- inverted={true} // Use maintainVisibleContentPosition instead
5351
- onBlankArea={handleBlankArea} // No longer supported
5452
- disableHorizontalListHeightMeasurement={true} // No longer needed
5553
- disableAutoLayout={true} // No auto layout in v2
@@ -75,32 +73,7 @@ overrideItemLayout={(layout, item) => {
7573
}}
7674
```
7775

78-
### Step 4: Replace Inverted Lists
79-
80-
If you were using `inverted` prop (common in chat apps), replace it with `maintainVisibleContentPosition` and reverse your data array:
81-
82-
```diff
83-
// v1 - Inverted list for chat
84-
<FlashList
85-
data={messages}
86-
renderItem={renderMessage}
87-
- inverted={true}
88-
- onEndReached={handler}
89-
/>
90-
91-
// v2 - Use maintainVisibleContentPosition
92-
<FlashList
93-
data={reversedMessages}
94-
renderItem={renderMessage}
95-
+ maintainVisibleContentPosition={{
96-
+ autoscrollToBottomThreshold: 0.2,
97-
+ startRenderingFromBottom: true,
98-
+ }}
99-
+ onStartReached={handler}
100-
/>
101-
```
102-
103-
### Step 5: Migrate MasonryFlashList to FlashList with masonry prop
76+
### Step 4: Migrate MasonryFlashList to FlashList with masonry prop
10477

10578
```diff
10679
// v1
@@ -126,7 +99,7 @@ If you were using `inverted` prop (common in chat apps), replace it with `mainta
12699

127100
Note: `getColumnFlex` from MasonryFlashList is not supported in v2.
128101

129-
### Step 6: Update Ref Types
102+
### Step 5: Update Ref Types
130103

131104
The ref type for FlashList has changed from `FlashList` to `FlashListRef`:
132105

@@ -146,6 +119,6 @@ The ref type for FlashList has changed from `FlashList` to `FlashListRef`:
146119
/>
147120
```
148121

149-
### Step 7: Replace CellContainer with View
122+
### Step 6: Replace CellContainer with View
150123

151124
`CellContainer` is no longer exported in v2. Replace it with React Native's `View`. Apps forwarding custom `CellRendererComponent` might need this change.

0 commit comments

Comments
 (0)