npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-redrag-and-drop

v0.3.3

Published

Drag and Drop using Reanimated v2

Downloads

3

Readme

react-native-redrag-and-drop

Easy drag and drop implementation for React Native.

Installation

npm install react-native-redrag-and-drop

or

yarn add react-native-redrag-and-drop

The package depends on react-native-gesture-handler and react-native-reanimated, your app should have those installed.

Usage

There are three components that you need to use: DragDropContainer, DragView and DropView.

import {
  DragDropContainer,
  DropView,
  DragView,
} from 'react-native-redrag-and-drop';

const App = () => {
  const [items, setItems] = useState([{ id: '1' }, { id: '2' }]);

  const onDrop = (dragId: string, dropId: string) => {
    // Remove dropped item
    setItems(items.filter((i) => i.id !== dragId));
  }

  return (
    <DragDropContainer>
      <DropView id='drop-1' style={styles.dropArea}/>
      {items.map((i) => {
        return (
          <DragView id={i.id} key={i.id}>
            <Text>Drag me</Text>
          </DragView>);
      })}
    </DragDropContainer>
  )
};

DragDropContainer

Use this view at the top level. The whole interaction will happen within the bounds of the container and the other views will be somewhere within that hierarchy.

Props | Description -------|------ dragDidStart?: (dragId: string) => void | This will be called when a drag starts happening, and you will get the id of the view being dragged. validDropIds?: (dragId: string) => string[] | Implement this to return a list of valid drop views for a given drag view. If a function is not provided, the default behavior will be to allow a drop for all drop views except the one currently containing the drag view, if any. dragDidMove?: (position: LayoutRectangle) => void | You can provide a worklet to be called during the animation, in case you want to animate some other view concurrently. The position will be in the coordinate system of the container. The function must be a worklet. onDropHover?: (dropId: string | undefined) => void | It will be called when a drag view enters the bounds of a drop view. onDrop?: (dragId: string, dropId: string) => void | Called when a drag view is dropped inside a drop view. You get both ids and can perform your state-changing actions here.

DropView

A DropView will allow you to drop a dragView in it. It is identified by a provided id string. It can have any children, including drag views.

Props | Description -------|-------- id: string | The id of this view. dragDidEnter?: (dragId: string) => void | Called when the dragView with the given dragId enters the bounds of this dropView. This can be used to highlight the drop view, for example dragDidLeave?: () => void | Called when a dragView left the bounds of this view.

DragView

A DragView will wrap the view that you want to move around and into a DropView. It should have children, as these are used to perform the drag animation.

Props | Description --------|-------- id: string | The id of this view.

Sample

Contributing

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

License

MIT