animation fix

This commit is contained in:
Robert 2024-03-08 23:17:31 +07:00
parent c3cde782bb
commit 8139ba86ac
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22

View File

@ -9,10 +9,12 @@ interface RootProps {
export default function Root({ children, className }: RootProps) {
return (
<motion.ul className={cn("", className)}>
<motion.ul layout className={cn("", className)}>
<AnimatePresence initial={false}>
{Children.map(children, (child, index) => (
<motion.li
layout
className="block"
key={index}
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: "auto" }}