How to use react-movable - 3 common examples

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});
  };
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 4 months ago

Package Health Score

73 / 100
Full package analysis

Popular react-movable functions