How to use the react-movable.arrayMove function in react-movable

To help you get started, we’ve selected a few react-movable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / baseweb / src / dnd-list / stateful-list-container.js View on Github external
onChange = ({
    oldIndex,
    newIndex,
    targetRect,
  }: {
    oldIndex: number,
    newIndex: number,
    targetRect: ClientRect,
  }) => {
    const newItemsState =
      newIndex === -1
        ? arrayRemove(this.state.items, oldIndex)
        : arrayMove(this.state.items, oldIndex, newIndex);
    this.props.onChange({
      newState: newItemsState,
      oldIndex,
      newIndex,
      targetRect,
    });
    this.internalSetState('change', {items: newItemsState});
  };

react-movable

Drag and drop lists.

MIT
Latest version published 5 days ago

Package Health Score

80 / 100
Full package analysis

Popular react-movable functions