Registry / testing / react-native-flashdrag-list

react-native-flashdrag-list

JSON →
library0.2.5jsnpmunverified

Draggable FlashList component for React Native that adds drag-and-drop sorting to @shopify/flash-list. Version 0.2.5 is the latest stable release; the package is actively maintained. Requires react-native-gesture-handler and react-native-reanimated for gesture and animation support. Ships TypeScript definitions. Differentiates from other drag-and-drop list libraries (e.g., react-native-draggable-flatlist) by leveraging FlashList for high-performance rendering of large lists.

npm install react-native-flashdrag-list
INSTALL
IMPORT
SIG · REACT-NATIVE-FLASH
R
react-native-flashdrag-list
testingjavascriptv0.2.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FlashDragList
import FlashDragList from 'react-native-flashdrag-list'
import { FlashDragList } from 'react-native-flashdrag-list'
Default export only; named import will fail.
FlashDragList (CommonJS)
const FlashDragList = require('react-native-flashdrag-list').default
const FlashDragList = require('react-native-flashdrag-list')
CJS require must access .default because the library exports an ES module.
TypeScript type for renderItem
import type { FlashDragListRenderItem } from 'react-native-flashdrag-list'
Available for type-checking the renderItem callback.

Complete example showing setup with GestureHandlerRootView, state management for drag sorting, and renderItem callback.

import React, { useState } from 'react'; import { SafeAreaView, Text, TouchableOpacity } from 'react-native'; import FlashDragList from 'react-native-flashdrag-list'; import { GestureHandlerRootView } from 'react-native-gesture-handler'; interface Item { title: string; color: string; } const NUM_ITEMS = 200; const ITEM_HEIGHT = 60; const App = () => { const [data, setData] = useState(() => new Array(NUM_ITEMS).fill('').map((_, i) => { const colors = ['#493548', '#4B4E6D', '#6A8D92', '#80B192', '#A1E887']; return { title: 'Item ' + i, color: colors[Math.round(i % colors.length)] }; }) ); const onSort = (fromIndex: number, toIndex: number) => { const copy = [...data]; const [removed] = copy.splice(fromIndex, 1); copy.splice(toIndex, 0, removed); setData(copy); }; const renderItem = (item: Item, index: number, active: boolean, beginDrag: () => any) => ( <TouchableOpacity onLongPress={beginDrag} style={{ width: '100%', height: ITEM_HEIGHT, alignItems: 'center', justifyContent: 'center', backgroundColor: item.color }}> <Text style={{ color: 'white', fontWeight: 'bold' }}>{item.title}</Text> </TouchableOpacity> ); return ( <GestureHandlerRootView style={{ flex: 1 }}> <SafeAreaView style={{ flex: 1, height: '100%', backgroundColor: 'white' }}> <FlashDragList data={data} renderItem={renderItem} itemsSize={ITEM_HEIGHT} onSort={onSort} /> </SafeAreaView> </GestureHandlerRootView> ); }; export default App;
Debug
Known issues
gotchaFlashDragList must be wrapped inside GestureHandlerRootView from react-native-gesture-handler. Missing wrapper causes gestures to not work.
fix
Wrap your app root or the component with GestureHandlerRootView as shown in the example.
affects: all
gotchaThe renderItem callback must call beginDrag on long press or touch event; otherwise dragging does not start.
fix
Attach onLongPress={beginDrag} to the touchable component in renderItem.
affects: all
deprecatedUsing named import { FlashDragList } instead of default import will result in undefined.
fix
Use import FlashDragList from 'react-native-flashdrag-list'.
affects: all
gotchaThe itemsSize prop is required and must be a constant number (e.g., 60). Dynamic sizes or varying item heights are not supported.
fix
Pass a fixed numeric value for itemsSize matching the height of each rendered item.
affects: all
breakingPeer dependency @shopify/flash-list must be installed separately; version compatibility is not enforced.
fix
Run npm install @shopify/flash-list.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'react-native-flashdrag-list'
Package not installed or npm cache issue.
fix
Run 'npm install react-native-flashdrag-list' and ensure node_modules contains it.
Invariant Violation: GestureHandlerRootView is not found.
GestureHandlerRootView is missing or not wrapping the component.
fix
Wrap the component tree with <GestureHandlerRootView style={{flex:1}}> and ensure react-native-gesture-handler is installed.
TypeError: (0 , _reactNativeFlashdragList.default) is not a function (it is undefined)
Using named import { FlashDragList } instead of default import.
fix
Change import to 'import FlashDragList from ...'.
FlashDragList: itemsSize prop is required and must be a number.
Missing itemsSize prop or wrong type.
fix
Pass a number like itemsSize={60}.
Upgrade
Version history
0.2.5latest on npm
Audit
Dependencies
@shopify/flash-listrequiredpeer dependency providing high-performance list rendering
react-native-gesture-handlerrequiredpeer dependency for drag gesture handling
react-native-reanimatedrequiredpeer dependency for smooth animations during drag
Agent activity
6 hits · last 30 days
node
6
Resources
react-native-flashdrag-list — npm install react-native-flashdrag-list · libregistry