Skip to content

Commit 8b23c8a

Browse files
authored
chore: Change useWidgetClose to accept any object with a close() method (#2561)
- Some plugin objects will have a close method and are not one of the known widget types
1 parent 4d955b4 commit 8b23c8a

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/jsapi-components/src/useWidgetClose.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { useEffect } from 'react';
2-
import { type WidgetTypes } from '@deephaven/jsapi-bootstrap';
32
import { isClosed } from '@deephaven/jsapi-utils';
43

54
/**
@@ -8,7 +7,7 @@ import { isClosed } from '@deephaven/jsapi-utils';
87
* @param widget The widget to close
98
*/
109
export default function useWidgetClose(
11-
widget: WidgetTypes | null | undefined
10+
widget: { close: () => void } | null | undefined
1211
): void {
1312
useEffect(
1413
() => () => {

0 commit comments

Comments
 (0)