diff --git a/package.json b/package.json index d32b3d5..020d478 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "react", "typescript" ], - "version": "2.1.6", + "version": "2.1.7", "main": "./dist/index.cjs.js", "module": "./dist/index.esm.js", "types": "./dist/index.d.ts", diff --git a/src/components/molecules/Modal/Modal.tsx b/src/components/molecules/Modal/Modal.tsx index 508c8a0..3848b1e 100644 --- a/src/components/molecules/Modal/Modal.tsx +++ b/src/components/molecules/Modal/Modal.tsx @@ -15,7 +15,7 @@ import { ModalPortalDedupleContext, ModalPortalDedupleProvider, } from 'contexts/ModalPortalDedupleContext' -import { motion } from 'framer-motion' +import { motion, AnimatePresence } from 'framer-motion' import { FlexProps } from 'components/atoms' import { Portal } from 'components/hocs/Portal' @@ -39,18 +39,6 @@ export type ModalProps = { disableUseOnClickOutside?: boolean } & Omit -const motionBackgroundVariants = { - hidden: { - opacity: 0, - transitionEnd: { - display: 'none', - }, - }, - visible: { - opacity: 1, - }, -} - const ModalBase = ({ render, externalIsOpen, @@ -87,25 +75,24 @@ const ModalBase = ({ - - - - {render({ isOpen: modalIsOpen, setIsOpen, excludeRef })} - - - + + {modalIsOpen ? ( + + + + {render({ isOpen: modalIsOpen, setIsOpen, excludeRef })} + + + + ) : null} +