Skip to content

Commit

Permalink
🤖 Merge PR #69866 Allow react resizable axis prop to have type none by …
Browse files Browse the repository at this point in the history
  • Loading branch information
jamcgre authored Jul 1, 2024
1 parent 49fc6c0 commit 49e6531
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
5 changes: 5 additions & 0 deletions types/react-resizable/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export type ResizableProps =
height: number;
axis: "y";
}
| {
width?: number | undefined;
height?: number | undefined;
axis: "none";
}
| {
width: number;
height: number;
Expand Down
24 changes: 24 additions & 0 deletions types/react-resizable/react-resizable-tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,27 @@ class TestXYResizableComponent extends React.Component<{ children?: React.ReactN
);
}
}

class TestNoneResizableComponent extends React.Component<{ children?: React.ReactNode }> {
render() {
return (
<Resizable
width={10}
height={20}
axis="none"
className={"foobar"}
minConstraints={[20, 20]}
maxConstraints={[42, 42]}
handleSize={[5, 5]}
lockAspectRatio={false}
draggableOpts={{ opaque: true }}
onResizeStart={resizeCallback}
onResizeStop={resizeCallback}
onResize={resizeCallback}
transformScale={1}
>
<div>{this.props.children}</div>
</Resizable>
);
}
}

0 comments on commit 49e6531

Please sign in to comment.