Skip to content

Commit b32d0b0

Browse files
committed
Add options for show method
1 parent ddeae1e commit b32d0b0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/future/index.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ export const useModal: UseModal = (options) => {
7979
() => false
8080
);
8181

82-
const open = useCallback(() => {
83-
ref.current?.showModal();
84-
}, []);
82+
const open: (options?: { isModal?: boolean }) => void = useCallback(
83+
(options = {}) => {
84+
if (options.isModal) {
85+
ref.current?.showModal();
86+
} else {
87+
ref.current?.show();
88+
}
89+
},
90+
[]
91+
);
8592

8693
const close = useCallback(() => {
8794
ref.current?.close();

0 commit comments

Comments
 (0)