Skip to content

Commit 9429196

Browse files
committed
Workaround for React.ComponentProps<typeof Button> no longer working
1 parent 37deb65 commit 9429196

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

packages/compass-components/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ export { Variant as BannerVariant } from '@leafygreen-ui/banner';
8282
export {
8383
Size as ButtonSize,
8484
Variant as ButtonVariant,
85+
type ButtonProps,
8586
} from '@leafygreen-ui/button';
8687
export { SplitButton } from '@leafygreen-ui/split-button';
8788

packages/compass-data-modeling/src/components/import-diagram-button.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
import React from 'react';
2-
import { Button, FileSelector } from '@mongodb-js/compass-components';
2+
import {
3+
Button,
4+
type ButtonProps,
5+
FileSelector,
6+
} from '@mongodb-js/compass-components';
37

4-
type importDiagramButtonProps = Omit<
5-
React.ComponentProps<typeof Button>,
6-
'onClick'
7-
> & {
8+
type ImportDiagramButtonProps = Omit<ButtonProps, 'onClick'> & {
89
onImportDiagram: (file: File) => void;
910
};
1011

1112
export const ImportDiagramButton = ({
1213
onImportDiagram,
1314
...buttonProps
14-
}: importDiagramButtonProps) => {
15+
}: ImportDiagramButtonProps) => {
1516
return (
1617
<FileSelector
1718
id="import-diagram-file-input"

0 commit comments

Comments
 (0)