In React, when a component is removed, it is usually removed instantly. Motion provides the AnimatePresence component which keeps elements in the DOM while they perform an exit animation.
AnimatePresence
Build by Ritesh. Check out my other Github Codes.