Giter Site home page Giter Site logo

evenchange4 / react-draggable-playground Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 93 KB

Reusable React-draggable components with render props.

Home Page: https://react-draggable-playground.netlify.com

License: MIT License

JavaScript 100.00%
react react-draggable

react-draggable-playground's Introduction

react-draggable-playground

Reusable React-draggable components with render props.

Travis Codecov Status npm package npm downloads

Dependency Status devDependency Status peerDependency Status

prettier license

Installation

$ yarn add react-draggable-playground

Demo

Usage

import { DraggableParent, DraggableItem } from 'react-draggable-playground';

<DraggableParent height={300} width={300}>
  <DraggableItem
    defaultPosition={{ x: 100, y: 100 }}
    onPositionChange={(position: Position) => {}}
  >
    {({ isDragging }) => <div>item</div>}
  </DraggableItem>
</DraggableParent>;

API

type Position = {
  x: number,
  y: number,
};

// DraggableItem
type Props = {
  children: ({ isDragging: boolean, disabled: boolean }) => React.Node,
  disabled: boolean,
  onPositionChange?: Position => Promise<void> | void,
  defaultPosition?: Position,
};

// DraggableParent
type Props = {
  height: number,
  width: number,
  children?: React.Node,
  style?: Object,
};

Development

Requirements

  • node >= 9.8.0
  • yarn >= 1.5.1
$ yarn install --pure-lockfile
$ yarn start

Test

$ yarn run format
$ yarn run eslint
$ yarn run flow
$ yarn run test:watch
$ yarn run build

CONTRIBUTING

  • โ‡„ Pull requests and โ˜… Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests.

MIT: http://michaelhsu.mit-license.org

react-draggable-playground's People

Contributors

evenchange4 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-draggable-playground's Issues

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Preset name not found within published preset config (monorepo:angularcli). Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency babel-eslint with @babel/eslint-parser
  • chore(deps): update dependency babel-eslint to v8.2.6
  • chore(deps): update dependency node to v9.11.2
  • chore(deps): update dependency babel-eslint to v10
  • chore(deps): update dependency babel-plugin-add-module-exports to v1
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-config-airbnb to v19
  • chore(deps): update dependency eslint-config-prettier to v9
  • chore(deps): update dependency eslint-plugin-flowtype to v8
  • chore(deps): update dependency eslint-plugin-jest to v28
  • chore(deps): update dependency eslint-plugin-prettier to v5
  • chore(deps): update dependency github-changes to v2
  • chore(deps): update dependency husky to v9
  • chore(deps): update dependency lint-staged to v15
  • chore(deps): update dependency node to v20
  • chore(deps): update dependency prettier to v3
  • chore(deps): update jest monorepo to v29 (major) (babel-jest, jest)
  • chore(deps): update react monorepo to v18 (major) (react, react-test-renderer)
  • chore(deps): update storybook monorepo (major) (@storybook/addon-actions, @storybook/addon-info, @storybook/addon-links, @storybook/addon-options, @storybook/addon-storyshots, @storybook/react)
  • fix(deps): update dependency react-draggable to v4
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • prop-types ^15.6.1
  • react-draggable ^3.0.5
  • @babel/cli 7.0.0-beta.42
  • @babel/core 7.0.0-beta.42
  • @babel/node 7.0.0-beta.42
  • @babel/preset-env 7.0.0-beta.42
  • @storybook/addon-actions 3.3.15
  • @storybook/addon-info 3.3.15
  • @storybook/addon-links 3.3.15
  • @storybook/addon-options 3.3.15
  • @storybook/addon-storyshots 3.3.15
  • @storybook/react 3.3.15
  • babel-core 7.0.0-bridge.0
  • babel-eslint 8.2.2
  • babel-jest 22.4.1
  • babel-plugin-add-module-exports 0.2.1
  • codecov 3.0.0
  • enzyme 3.3.0
  • enzyme-adapter-react-16 1.1.1
  • enzyme-to-json 3.3.3
  • eslint 4.19.1
  • eslint-config-airbnb 16.1.0
  • eslint-config-prettier 2.9.0
  • eslint-plugin-flowtype 2.46.1
  • eslint-plugin-import 2.9.0
  • eslint-plugin-jest 21.15.0
  • eslint-plugin-jsx-a11y 6.0.3
  • eslint-plugin-prettier 2.6.0
  • eslint-plugin-react 7.7.0
  • flow-bin 0.68.0
  • github-changes 1.1.2
  • husky 0.14.3
  • jest 22.4.2
  • lint-staged 7.0.0
  • prettier 1.11.1
  • react 16.2.0
  • react-dom 16.2.0
  • react-test-renderer 16.2.0
nvm
.nvmrc
  • node 9.8.0
travis
.travis.yml
  • node 9.8.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.