import { motion, AnimatePresence } from 'framer-motion';
<AnimatePresence>
  {isOpen && (
   <motion.div
     key="modal"
     ref={sheetRef}
     initial={{ y: '100%' }}
     animate={{
       y: '0%',
      transition: { duration: 0.2, ease: 'linear' },
     }}
     exit={{
      y: '100%',
      transition: { duration: 0.2, ease: 'linear' },
     }}
  >
  .......
  </motion.div>
))</AnimatePresence>

The exist transition is not working while I close the sheet.