From c82110f7d3a2f85de99045fde7b579e369f15b2c Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Sat, 28 Oct 2023 09:05:00 +0700
Subject: Update authentication feature

---
 src-migrate/common/components/elements/Modal.tsx | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'src-migrate/common/components/elements/Modal.tsx')

diff --git a/src-migrate/common/components/elements/Modal.tsx b/src-migrate/common/components/elements/Modal.tsx
index 91421251..8e488a3a 100644
--- a/src-migrate/common/components/elements/Modal.tsx
+++ b/src-migrate/common/components/elements/Modal.tsx
@@ -1,5 +1,6 @@
 import { XMarkIcon } from "@heroicons/react/24/outline";
 import { AnimatePresence, motion } from "framer-motion"
+import { useRouter } from "next/router";
 import { useEffect, useState } from "react";
 import ReactDOM from "react-dom";
 import { useWindowSize } from "usehooks-ts";
@@ -23,6 +24,7 @@ const Modal = ({
   className,
   mode
 }: Props) => {
+  const router = useRouter()
   const { width } = useWindowSize()
   const [rendered, setRendered] = useState<boolean>(false)
 
@@ -49,7 +51,7 @@ const Modal = ({
   }
 
   return rendered && ReactDOM.createPortal(
-    <AnimatePresence>
+    <AnimatePresence key={router.asPath}>
       {active && (
         <motion.div
           className="overlay"
-- 
cgit v1.2.3

