Skip to content

Commit 3e655c9

Browse files
committed
fix key
1 parent 978f232 commit 3e655c9

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/context.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createContext, ReactNode, useContext } from "react";
1+
import { createContext, Fragment, ReactNode, useContext } from "react";
22
import { ModalItemProvider } from "./item-context";
33
import {
44
InternalModalInstance,
@@ -60,7 +60,7 @@ function Modals({
6060
};
6161

6262
return (
63-
<ModalItemProvider key={internalModalItem.id} modal={internalModalItem}>
63+
<ModalItemProvider modal={internalModalItem}>
6464
{modal ? (
6565
modal(modalProps, modalManager)
6666
) : (
@@ -82,7 +82,11 @@ function Modals({
8282
return (
8383
<>
8484
{isLoading && loading && loading(modalManager)}
85-
{stack.map((internalModal) => renderModal(internalModal))}
85+
{stack.map((internalModal) => (
86+
<Fragment key={internalModal.id}>
87+
{renderModal(internalModal)}
88+
</Fragment>
89+
))}
8690
{(isLoading || stack.length > 0) && backdrop && backdrop(modalManager)}
8791
</>
8892
);

0 commit comments

Comments
 (0)