0.1.3 • Published 4 years ago

@sushantdsuwal/react-native-drag v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-native-drag

draggable, drag n drop, reanimated-draggable

Installation

npm install @sushantdsuwal/react-native-drag

myfile

Usage

import Drag from "@sushantdsuwal/react-native-drag";

// ...

<Drag
  height={height} // element height
  width={width} // element width
  x={x} // x position for element
  y={y} // y position for element
  maxHeight={maxHeight} //layout max height
  maxWidth={maxWidth} //layout max width
  onDragEnd={(boxPosition) => {
    const newBoxPosition = {
      ...boxPosition,
      x: boxPosition.x,
      y: boxPosition.y,
      height: boxPosition.height,
      width: boxPosition.width,
    }
  }} // new position of element after drag
>
  <View><Text>Box 1</Text></View>
</Drag>

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT