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
Copy file name to clipboardExpand all lines: README.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,8 @@
1
1
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)
@@ -11,7 +14,7 @@ To use swipeable list items in a DraggableFlatList see [React Native Swipeable I
11
14
12
15
## Install
13
16
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)
15
18
2. Install this package using `npm` or `yarn`
16
19
17
20
with `npm`:
@@ -40,13 +43,13 @@ All props are spread onto underlying [FlatList](https://facebook.github.io/react
40
43
|`ref`|`React.RefObject<FlatList<T>>`| FlatList ref to be forwarded to the underlying FlatList. |
41
44
|`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`). |
42
45
|`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)|
44
47
|`onDragBegin`|`(index: number) => void`| Called when row becomes active. |
45
48
|`onRelease`|`(index: number) => void`| Called when active row touch ends. |
46
49
|`onDragEnd`|`(params: { data: T[], from: number, to: number }) => void`| Called after animation has completed. Returns updated ordering of `data`|
47
50
|`autoscrollThreshold`|`number`| Distance from edge of container where list begins to autoscroll when dragging. |
48
51
|`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)|
50
53
|`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. |
51
54
|`onScrollOffsetChange`|`(offset: number) => void`| Called with scroll offset. Stand-in for `onScroll`. |
52
55
|`onPlaceholderIndexChange`|`(index: number) => void`| Called when the index of the placeholder changes |
0 commit comments