0.1.1 • Published 6 years ago

@react-qui/hoc v0.1.1

Weekly downloads
-
License
-
Repository
-
Last release
6 years ago

@react-qui/hoc

A react high-order-component toolbox for react-qui.

withDraggable

A component passed to the hoc will be transformed into a draggable component.

import { withDraggable } from '@react-qui/hoc'

const Draggable = withDraggable({
  position: 'absolute',
  zIndex: '9999',
  center: true
})(_ => (
  <div
    style={{
      background: 'tomato',
      width: '300px',
      height: '50px',
      lineHeight: '50px'
    }}
  >
    I can be dragged.
  </div>
));