Skip to content

Commit

Permalink
Fix FlatList docs - had a sentence that doesn't make sense (facebook#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lyahdav authored Aug 21, 2020
1 parent f8b9f04 commit 4610421
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/flatlist.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export default App;

To render multiple columns, use the [`numColumns`](flatlist.md#numcolumns) prop. Using this approach instead of a `flexWrap` layout can prevent conflicts with the item height logic.

More complex, multi-select example demonstrating `` usage for perf optimization and avoiding bugs.
More complex, selectable example below.

- By passing `extraData={selected}` to `FlatList` we make sure `FlatList` itself will re-render when the state changes. Without setting this prop, `FlatList` would not know it needs to re-render any items because it is a `PureComponent` and the prop comparison will not show any changes.
- By passing `extraData={selectedId}` to `FlatList` we make sure `FlatList` itself will re-render when the state changes. Without setting this prop, `FlatList` would not know it needs to re-render any items because it is a `PureComponent` and the prop comparison will not show any changes.
- `keyExtractor` tells the list to use the `id`s for the react keys instead of the default `key` property.

```SnackPlayer name=flatlist-selectable
Expand Down

0 comments on commit 4610421

Please sign in to comment.