Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-reorder-list

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-reorder-list - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0

5

dist/index.d.ts

@@ -6,4 +6,5 @@ import React, { DetailedHTMLProps, HTMLAttributes, ReactNode } from "react";

end?: number;
oldItems?: ReactNode;
newItems?: ReactNode;
oldItems?: ReactNode[];
newItems?: ReactNode[];
revert?: () => void;
}) => void;

@@ -10,0 +11,0 @@ export type ReorderListProps = {

2

dist/index.js

@@ -44,3 +44,3 @@ var __rest = (this && this.__rest) || function (s, e) {

if (end !== start)
onPositionChange === null || onPositionChange === void 0 ? void 0 : onPositionChange({ start, end, oldItems: temp.items, newItems: items });
onPositionChange === null || onPositionChange === void 0 ? void 0 : onPositionChange({ start, end, oldItems: temp.items, newItems: items, revert: () => setItems(temp.items) });
setStart(-1);

@@ -47,0 +47,0 @@ setSelected(-1);

{
"name": "react-reorder-list",
"version": "0.3.1",
"version": "0.4.0",
"description": "A simple react component that facilitates the reordering of JSX/HTML elements through drag-and-drop functionality, allowing for easy position changes.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -140,5 +140,13 @@ # react-reorder-list

import { ReactNode } from 'react';
type PositionChangeHandler = (params?: { start?: number, end?: number, oldItems?: ReactNode, newItems?: ReactNode }) => void
type RevertHandler = () => void
type PositionChangeParams = {
start?: number // Index of the item being dragged
end?: number // Index of the item being displaced by the starting item
oldItems?: ReactNode[] // Array of children before reordering
newItems?: ReactNode[] // Array of children after reordering
revert: RevertHandler // A fallback handler to revert the reordering
}
type PositionChangeHandler = (params?: PositionChangeParams) => void
```
## Author
[Sahil Aggarwal](https://www.github.com/SahilAggarwal2004)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc