Socket
Socket
Sign inDemoInstall

react-multi-split-pane

Package Overview
Dependencies
6
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

1

dist/lib/SplitPane.d.ts

@@ -9,2 +9,3 @@ import * as React from 'react';

onDragStarted?: () => void;
onChange?: (sizes: number[]) => void;
onDragFinished?: (sizes: number[]) => void;

@@ -11,0 +12,0 @@ }

9

dist/lib/SplitPane.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const React = require("react");
const { useCallback, useRef, useState, useMemo } = React;
const { useCallback, useRef, useState, useMemo, useEffect } = React;
const Pane_1 = require("./Pane");

@@ -66,3 +66,3 @@ const Resizer_1 = require("./Resizer");

function useSplitPaneResize(options) {
const { children, split, defaultSizes, minSize: minSizes, onDragStarted, onDragFinished } = options;
const { children, split, defaultSizes, minSize: minSizes, onDragStarted, onChange, onDragFinished } = options;
const [sizes, setSizes] = useState(new Map());

@@ -91,2 +91,7 @@ const paneRefs = useRef(new Map());

const resizeState = dragState ? dragState.extraState : null;
useEffect(() => {
if (onChange && dragState) {
onChange(movedSizes);
}
}, [dragState, movedSizes, onChange]);
const childPanes = useMemo(() => {

@@ -93,0 +98,0 @@ const prevPaneRefs = paneRefs.current;

@@ -31,6 +31,6 @@ "use strict";

const onMouseUp = () => {
setDragging(null);
if (onDragFinished) {
onDragFinished(dragState);
}
setDragging(null);
};

@@ -37,0 +37,0 @@ return [dragState, onMouseUp];

@@ -9,3 +9,3 @@ {

],
"version": "0.2.0",
"version": "0.2.1",
"repository": {

@@ -12,0 +12,0 @@ "type": "git",

@@ -36,7 +36,2 @@ # React Multi Split Pane

## Notes for updating from react-multi-split-pane v0.1.x
All code has been cleaned up significantly by moving to React Hooks. Due to
the restructuring, the `onChange` callback is not supported anymore.
## Differences from [react-split-pane](https://github.com/tomkp/react-split-pane)

@@ -78,2 +73,6 @@

### onChange: (sizes: number[]) => void
This callback is invoked with the current drag during a drag event. It is
recommended that it is wrapped in a debounce function.
## Persisting Positions

@@ -80,0 +79,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc