react-reorder-list 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +7 -4
  2. package/package.json +2 -4
package/README.md CHANGED
@@ -32,7 +32,7 @@ import ReorderList from 'react-reorder-list'
32
32
 
33
33
  export default function App() {
34
34
  return <ReorderList useOnlyIconToDrag={false}>
35
- {[0, 1, 2, 3, 4].map(i=> {
35
+ {[0, 1, 2, 3, 4].map(i => {
36
36
  {/* Having a unique key is important */}
37
37
  return <div key={i}>{i}</div>
38
38
  })}
@@ -47,9 +47,12 @@ import ReorderList, { ReorderIcon } from 'react-reorder-list'
47
47
 
48
48
  export default function App() {
49
49
  return <ReorderList>
50
- {[0, 1, 2, 3, 4].map(i=> {
50
+ {[0, 1, 2, 3, 4].map(i => {
51
51
  return <div key={i}>
52
- <ReorderIcon />
52
+ <ReorderIcon /> {/* Default icon */}
53
+ <ReorderIcon>
54
+ {/* Custom icon/component */}
55
+ </Reordericon>
53
56
  <span>{i}</span>
54
57
  </div>
55
58
  })}
@@ -86,7 +89,7 @@ Here is the full API for the `<ReorderList>` component, these properties can be
86
89
  | - | - | - | - | - |
87
90
  | `useOnlyIconToDrag` | `Boolean` | No | true | See [usage with ReorderIcon](#usage-with-reordericon) |
88
91
  | `selectedItemOpacity` | `Number (0 to 1)` | No | 0.5 | This determines the opacity of the item being dragged, until released. |
89
- | `onPositionChange` | [`PositionChangeHandler`](#positionchangehandler) | No | - | |
92
+ | `onPositionChange` | [`PositionChangeHandler`](#positionchangehandler) | No | - | Function to be executed on item position change. |
90
93
  | `disable` | `Boolean` | No | false | When set to true, `ReorderList` will work as a plain `div` with no functionality. |
91
94
  | `props` | `React.DetailedHTMLProps` | No | - | Props to customize the `<ReorderList>` component. |
92
95
  ### Types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-reorder-list",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "A simple react component that facilitates the reordering of JSX/HTML elements through drag-and-drop functionality, allowing for easy position changes.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,9 +17,7 @@
17
17
  "component",
18
18
  "drag-and-drop",
19
19
  "dnd",
20
- "typescript",
21
- "jsx",
22
- "html"
20
+ "typescript"
23
21
  ],
24
22
  "author": "Sahil Aggarwal",
25
23
  "license": "MIT",