Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
mayank99 committed Apr 4, 2024
1 parent e3defd8 commit d8a858c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/itwinui-react/src/core/Dialog/Dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,20 @@ const synchronizeInstance = (

// ----------------------------------------------------------------------------

type DialogInstance = {
show: () => void;
close: () => void;
};

type DialogProps = {
/**
* Dialog content.
*/
children: React.ReactNode;
instance?: Instance;
/**
* Pass an instance created by `useInstance` to control the dialog programmatically.
*/
instance?: DialogInstance;
} & Omit<DialogContextProps, 'dialogRootRef' | 'setIsOpen'>;

const DialogComponent = React.forwardRef((props, forwardedRef) => {
Expand Down Expand Up @@ -147,5 +155,5 @@ export const Dialog = Object.assign(DialogComponent, {
TitleBar: DialogTitleBar,
Content: DialogContent,
ButtonBar: DialogButtonBar,
useInstance,
useInstance: useInstance as unknown as () => DialogInstance,
});

0 comments on commit d8a858c

Please sign in to comment.