Skip to content

Commit 1e5f5b5

Browse files
authored
Update README.md
1 parent cb34bd9 commit 1e5f5b5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11

2-
⚠️ NOTE: You are viewing the README for version 3, [version 2 README here](https://github.com/computerjazz/react-native-draggable-flatlist/blob/b60c23035fc0371a735cde1d000e9ad7f8e0f049/README.md)
2+
⚠️ You are viewing the README for v4 (view
3+
[v3](https://github.com/computerjazz/react-native-draggable-flatlist/blob/17897b3b5d771e854c9ccbd952332f5deabbd85d/README.md),
4+
[v2](https://github.com/computerjazz/react-native-draggable-flatlist/blob/b60c23035fc0371a735cde1d000e9ad7f8e0f049/README.md)
5+
)
36

47
# React Native Draggable FlatList
58

@@ -11,7 +14,7 @@ To use swipeable list items in a DraggableFlatList see [React Native Swipeable I
1114

1215
## Install
1316

14-
1. Follow installation instructions for [reanimated](https://github.com/kmagiera/react-native-reanimated) and [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler). RNGH requires you to make changes to `MainActivity.java`. Be sure to [follow all Android instructions!](https://docs.swmansion.com/react-native-gesture-handler/docs/#android)
17+
1. Follow installation instructions for [reanimated](https://github.com/kmagiera/react-native-reanimated) and [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler). RNGH may require you to make changes to `MainActivity.java`. Be sure to [follow all Android instructions!](https://docs.swmansion.com/react-native-gesture-handler/docs/#android)
1518
2. Install this package using `npm` or `yarn`
1619

1720
with `npm`:
@@ -40,13 +43,13 @@ All props are spread onto underlying [FlatList](https://facebook.github.io/react
4043
| `ref` | `React.RefObject<FlatList<T>>` | FlatList ref to be forwarded to the underlying FlatList. |
4144
| `renderItem` | `(params: { item: T, getIndex: () => number \| undefined, drag: () => void, isActive: boolean}) => JSX.Element` | Call `drag` when the row should become active (i.e. in an `onLongPress` or `onPressIn`). |
4245
| `renderPlaceholder` | `(params: { item: T, index: number }) => React.ReactNode` | Component to be rendered underneath the hovering component |
43-
| `keyExtractor` | `(item: T, index: number) => string` | Unique key for each item |
46+
| `keyExtractor` | `(item: T, index: number) => string` | Unique key for each item (required) |
4447
| `onDragBegin` | `(index: number) => void` | Called when row becomes active. |
4548
| `onRelease` | `(index: number) => void` | Called when active row touch ends. |
4649
| `onDragEnd` | `(params: { data: T[], from: number, to: number }) => void` | Called after animation has completed. Returns updated ordering of `data` |
4750
| `autoscrollThreshold` | `number` | Distance from edge of container where list begins to autoscroll when dragging. |
4851
| `autoscrollSpeed` | `number` | Determines how fast the list autoscrolls. |
49-
| `animationConfig` | `Partial<Animated.SpringConfig>` | Configure list animations. See [reanimated spring config](https://github.com/software-mansion/react-native-reanimated/blob/12093cbe04d978b2ef619531755ef7d472242cd9/react-native-reanimated.d.ts#L198-L206) |
52+
| `animationConfig` | `Partial<WithSpringConfig>` | Configure list animations. See [reanimated spring config](https://docs.swmansion.com/react-native-reanimated/docs/api/animations/withSpring/#options-object) |
5053
| `activationDistance` | `number` | Distance a finger must travel before the gesture handler activates. Useful when using a draggable list within a TabNavigator so that the list does not capture navigator gestures. |
5154
| `onScrollOffsetChange` | `(offset: number) => void` | Called with scroll offset. Stand-in for `onScroll`. |
5255
| `onPlaceholderIndexChange` | `(index: number) => void` | Called when the index of the placeholder changes |

0 commit comments

Comments
 (0)