Skip to content

Commit ca7dd48

Browse files
committed
feat: optimized render times for modal provider
1 parent 5af51c1 commit ca7dd48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/create-use-modal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ export const createUseModal = <
99
...param: CreateModalFunctionParam<Data, Param>
1010
) => {
1111
const Modal = createModal<Data, Param>(...param);
12-
return () => useModal<typeof Modal>(<Modal />);
12+
const modalElement = <Modal />;
13+
return () => useModal<typeof Modal>(modalElement);
1314
};

0 commit comments

Comments
 (0)