https://github.com/zyzo/react-dnd-mouse-backend
Mouse Backend for react-dnd library
https://github.com/zyzo/react-dnd-mouse-backend
react react-dnd
Last synced: about 1 year ago
JSON representation
Mouse Backend for react-dnd library
- Host: GitHub
- URL: https://github.com/zyzo/react-dnd-mouse-backend
- Owner: zyzo
- License: mit
- Created: 2016-03-08T21:36:37.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T01:30:55.000Z (over 3 years ago)
- Last Synced: 2025-03-30T21:11:51.745Z (about 1 year ago)
- Topics: react, react-dnd
- Language: JavaScript
- Homepage: http://zyzo.github.io/react-dnd-mouse-backend/
- Size: 1.47 MB
- Stars: 85
- Watchers: 6
- Forks: 30
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-github-projects - react-dnd-mouse-backend - Mouse Backend for react-dnd library ⭐84 `JavaScript` (📦 Legacy & Inactive Projects)
README
# react-dnd-mouse-backend
http://zyzo.github.io/react-dnd-mouse-backend/
[](https://badge.fury.io/js/react-dnd-mouse-backend)
Mouse Backend for React Drag and Drop library http://gaearon.github.io/react-dnd
- [Usage](#Usage)
- [Playground](#Playground)
- [Development](#Development)
- [Credits](#Credits)
### Usage
```js
import { DragDropContext } from 'react-dnd'
import MouseBackEnd from 'react-dnd-mouse-backend'
const App = {...}
const AppContainer = DragDropContext(MouseBackEnd)(App)
```
### Playground
First, prepare the playground:
```sh
cd example;
yarn; yarn start
```
Then head to `http://localhost:3030/` to start some fun drag and dropping.
### Development
First, install the project locally:
```sh
git clone git@github.com:zyzo/react-dnd-mouse-backend.git
cd react-dnd-mouse-backend; npm install
# (Optional) prepare example project
cd example; npm install
```
Then, link react-dnd-mouse-backend to example project (or your js project):
```sh
# in ./react-dnd-mouse-backend
npm link
cd example; npm link react-dnd-mouse-backend
```
Finally you can begin to make changes in `src` folder, and rebuild the lib:
```sh
npm run build
```
### Credits
Inspired by [HTML5 Backend](https://github.com/gaearon/react-dnd-html5-backend) & [Touch Backend](https://github.com/yahoo/react-dnd-touch-backend) to support only mouse events, which work much better in some cases, like svg.