Skip to content

Commit ab6fdf6

Browse files
committed
chore: fallback
1 parent 6780706 commit ab6fdf6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hooks/useDrag.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export interface UseDragOptions {
1010
style?: React.CSSProperties;
1111
maxSize?: number;
1212
containerRef?: React.RefObject<HTMLElement>;
13-
currentSize?: number;
13+
currentSize?: number | string;
1414
onResize?: (size: number) => void;
1515
onResizeEnd?: (size: number) => void;
1616
onResizeStart?: (size: number) => void;
@@ -59,7 +59,7 @@ export default function useDrag(options: UseDragOptions): UseDragReturn {
5959

6060
// Use provided currentSize, or fallback to container size
6161
let startSize: number;
62-
if (currentSize !== undefined) {
62+
if (typeof currentSize === 'number') {
6363
startSize = currentSize;
6464
} else if (containerRef?.current) {
6565
const rect = containerRef.current.getBoundingClientRect();

0 commit comments

Comments
 (0)