You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+36-27Lines changed: 36 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,8 @@ repository and running `$ make`. This will create umd dist files in the `dist/`
24
24
25
25
### Exports
26
26
27
-
The default export is `<Draggable>`. At the `.DraggableCore` property is `<DraggableCore>`. Here's how to use it:
27
+
The default export is `<Draggable>`. At the `.DraggableCore` property is [`<DraggableCore>`](#draggablecore).
28
+
Here's how to use it:
28
29
29
30
```js
30
31
// ES6
@@ -37,7 +38,7 @@ let Draggable = require('react-draggable');
37
38
let DraggableCore =Draggable.DraggableCore;
38
39
```
39
40
40
-
## Draggable
41
+
## `<Draggable>`
41
42
42
43
A `<Draggable>` element wraps an existing element and extends it with new event handlers and styles.
43
44
It does not create a wrapper element in the DOM.
@@ -54,15 +55,15 @@ an intermediate wrapper (`<Draggable><span>...</span></Draggable>`) in this case
54
55
The `<Draggable/>` component transparently adds draggable to whatever element is supplied as `this.props.children`.
55
56
**Note**: Only a single element is allowed or an Error will be thrown.
56
57
57
-
For the `<Draggable/>` component to correctly attach itself to its child, the child element must provide support for the following props:
58
+
For the `<Draggable/>` component to correctly attach itself to its child, the child element must provide support
59
+
for the following props:
58
60
-`style` is used to give the transform css to the child.
59
61
-`className` is used to apply the proper classes to the object being dragged.
60
-
-`onMouseDown` is used along with onMouseUp to keep track of dragging state.
61
-
-`onMouseUp` is used along with onMouseDown to keep track of dragging state.
62
-
-`onTouchStart` is used along with onTouchEnd to keep track of dragging state.
63
-
-`onTouchEnd` is used along with onTouchStart to keep track of dragging state.
62
+
-`onMouseDown`, `onMouseUp`, `onTouchStart`, and `onTouchEnd` are used to keep track of dragging state.
64
63
65
-
React.DOM elements support the above six properties by default, so you may use those elements as children without any changes. If you wish to use a React component you created, you might find [this React page](https://facebook.github.io/react/docs/transferring-props.html) helpful.
64
+
React.DOM elements support the above six properties by default, so you may use those elements as children without
65
+
any changes. If you wish to use a React component you created, you might find
0 commit comments