fivecar / react-native-draglist

FlatList that can be reordered by dragging its items
MIT License
118 stars 19 forks source link

fix: Refactor onStartDrag and onEndDrag to not require parameters #41

Open lavi02 opened 5 months ago

lavi02 commented 5 months ago

In the situation below, onStartDrag and onEndDrag are still required despite being deprecated, causing issues that need to be addressed.

<DragList
          data={inputResult}
          ref={scrollRef}
          keyboardShouldPersistTaps="always"
          onReordered={(from, to) => {
            ...
          }}
          keyExtractor={(item) => item.id}
          renderItem={(data) => (
            <RenderOrderList
              ref={inputRef}
              separators={data.separators}
              index={data.index}
              isActive={data.isActive}
              item={data.item}
              // need to use onStartDrag & onEndDrag even being deprecated
              onDragEnd={data.onDragEnd}
              onDragStart={data.onDragStart}
            />
          )}
        />