Skip to content

Releases: nuclearpasta/react-native-drax

v1.1.0

23 Mar 18:16
1bd9e77

Choose a tag to compare

Added

  • Mixed-size grid support: getItemSpan prop on useSortableList / DraxList — return { colSpan, rowSpan } per item for variable-width/height sortable grids
  • packGrid utility: bin-packing algorithm that places items left-to-right, top-to-bottom into a 2D occupancy grid — exported from react-native-drax for computing grid positions in render functions
  • ScrollView auto-scroll: SortableContainer now supports ScrollView in addition to FlatList / FlashList / LegendList for auto-scrolling during drag
  • Hover position reset: hover content now strips positioning styles (position, left, top, right, bottom) and margins — prevents double-displacement when items use position: 'absolute' with offsets

Fixed

  • npm homepage now correctly points to the documentation site
  • Color drag-drop example: centered snap alignment on drop

Changed

  • Updated branding to NuclearPasta across docs site and example app (logos, favicons, social cards)
  • Example app now includes 11 screens (added mixed-size grid example)
  • Corrected Reanimated and Gesture Handler version numbers in documentation comparison tables

v1.0.0

22 Mar 19:43
5a473c4

Choose a tag to compare

Complete rewrite of the library. This is a major release with breaking changes from all prior versions.

Architecture

  • Rewritten on Reanimated 4 and Gesture Handler 3 (beta)
  • UI-thread-first architecture: spatial index worklet for hit-testing, SharedValues split by update frequency
  • New Architecture (Fabric) compatible
  • Web platform support
  • Single HoverLayer, per-view gesture handlers
  • Gesture Handler v2 supported via compatibility layer (v3 recommended for best performance)

Added

  • List-agnostic sortable API: useSortableList hook + SortableContainer + SortableItem composable primitives — works with FlatList, FlashList, LegendList, or any list component
  • DraxList convenience wrapper: list-agnostic sortable list with component prop to swap list implementations
  • Cross-container sortable (experimental): useSortableBoard + SortableBoardContainer for cross-list reorder patterns
  • Drag handles: DraxHandle component + dragHandle prop — only the handle area starts a drag
  • Drag bounds: dragBoundsRef prop constrains drags within a boundary view
  • Collision algorithms: collisionAlgorithm prop — 'center' (default), 'intersect', 'contain'
  • Drop zone acceptance: acceptsDrag convenience prop + dynamicReceptiveCallback for conditional drop acceptance
  • Hover styles: 5 hover-specific style props — hoverStyle, hoverDraggingStyle, hoverDraggingWithReceiverStyle, hoverDraggingWithoutReceiverStyle, hoverDragReleasedStyle
  • Snap alignment: snapToAlignment() utility for 9-point alignment within receivers
  • Animation presets: 'default', 'spring', 'gentle', 'snappy', 'none' — plus custom spring/timing config
  • Continuous drag callbacks: onDrag, onDragOver, onReceiveDragOver fire every gesture frame
  • Accessibility: auto-generated accessibilityLabel/accessibilityHint on sortable items, useReducedMotion() support
  • Namespace API: import { Drax } from 'react-native-drax' for Drax.View, Drax.Provider, etc.
  • Drop indicator support: renderDropIndicator prop on SortableContainer
  • Insert + swap reorder strategies
  • 10 example screens in the bundled Expo Router example app

Changed

  • (BREAKING) Peer dependency: react-native-reanimated ^4.0.0 required
  • (BREAKING) Peer dependency: react-native-gesture-handler >=2.0.0 required (v3 recommended)
  • (BREAKING) Peer dependency: react >=18.0.0 required
  • (BREAKING) DraxList is completely new — list-agnostic wrapper using the new sortable architecture
  • (BREAKING) dynamicReceptiveCallback signature changed: receives draggedPayload parameter

Removed

  • (BREAKING) Old DraxList component (v0.10.x API with renderItemContent/renderHoverContent and v0.11.0-alpha API with renderItem(info, itemProps))
  • (BREAKING) DraxListItem component — replaced by SortableItem
  • (BREAKING) All legacy list types: DraxListProps (old), DraxListItemProps, DraxListDraggedItemData, DraxListOnItemDragStartEventData, DraxListOnItemDragPositionChangeEventData, DraxListOnItemDragEndEventData, DraxListOnItemReorderEventData, DraxListRenderItemContent, DraxListRenderItemHoverContent, DraxListOnItemReorder