Skip to content

Releases: Guccio163/react-native-reshuffled

Reshuffled - 0.2.3

27 Mar 10:34
22bd3fd

Choose a tag to compare

Key changes

New props

  • allowCollisions — when true, dragged items can overlap others and the grid does not auto-adjust positions after a drop.

  • getNewGrid — optional callback that replaces the default best-fit reshuffling algorithm so user can implement custom rules (e.g. swap on a single overlap, shuffle all cards randomly etc.).

  • onDragEnd — optional callback invoked after every successful drop with the updated item array.

Grid usage

  • Breaking — Reshuffled.Grid namespace API — the grid is no longer exported as ReshufflableGrid. Import the namespace and use the .Grid property:

    // before
    import { ReshufflableGrid } from 'react-native-reshuffled'
    <ReshufflableGrid ... />
    // after
    import { Reshuffled } from 'react-native-reshuffled'
    <Reshuffled.Grid ... />

Fixes

  • Z-order after drop — fixed the dragged tile zIndex flicker after drop.

Refactors

  • ReshufflableGrid — mobile and web implementation reorganized into ReshufflableGridCore abstraction and the useReshufflableGrid hook to separate layout/state logic from presentation.

Other

  • Example: puzzles — demo update with a screen comparing collision mode vs custom getNewGrid behavior.