Files
EpicNext-Cms/src/components/motion-page-wrapper.tsx
T
openhands 3827f3e686
Deploy / release (push) Skipped
Deploy / deploy (push) Successful in 2m4s
Migrate from framer-motion to motion/react
2026-07-28 18:49:25 +02:00

29 lines
555 B
TypeScript

"use client";
import { AnimatePresence, motion } from "motion/react";
import { usePathname } from "next/navigation";
import type { ReactNode } from "react";
import { pageTransition } from "@/lib/motion";
export default function MotionPageWrapper({
children,
}: {
children: ReactNode;
}) {
const pathname = usePathname();
return (
<AnimatePresence mode="wait">
<motion.div
key={pathname}
variants={pageTransition}
initial="initial"
animate="enter"
exit="exit"
>
{children}
</motion.div>
</AnimatePresence>
);
}