Skip to content

Draggable Items Disappear When Using Zustand (Works with useState) #591

@WallysonGalvao

Description

@WallysonGalvao

Description

When using react-native-draggable-flatlist with Zustand state management, the list items disappear from the screen during drag operations. The same implementation works correctly with React's native useState.

Reproduction Steps

  1. Create a component using react-native-draggable-flatlist with Zustand
  2. Implement drag logic as shown in official examples
  3. Attempt to drag items
  4. Observe items disappearing (Zustand) vs working normally (useState)

Live Reproduction:
Expo Snack Demo

Code Comparison

Working (useState):

const [items, setItems] = useState(DATA);
useState.mp4

Broken (Zustand):

const { items, setItems } = useMyStore(); // Zustand store
useStore.mp4

Expected vs Actual Behavior

Expected:
Items should remain visible and draggable (as with useState implementation).

Actual:

  • Items disappear during drag operations
  • No error messages in console
  • UI becomes unresponsive after disappearance

Environment

Dependency Version
react-native-draggable-flatlist 4.0.2
zustand 5.0.3
react 19.0.0
react-native 0.79.1
react-native-gesture-handler 2.25.0
react-native-reanimated 3.17.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions