mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:56:28 +00:00
17 lines
500 B
TypeScript
17 lines
500 B
TypeScript
// components/motion-wrapper.tsx
|
|
"use client";
|
|
|
|
import { motion } from 'motion/react';
|
|
import { ComponentProps } from 'react';
|
|
|
|
// This automatically extracts every possible prop that motion.div accepts,
|
|
// including standard HTML div props (className, onClick, etc.)
|
|
type MotionWrapperProps = ComponentProps<typeof motion.div>;
|
|
|
|
export function MotionDiv({ children, ...props }: MotionWrapperProps) {
|
|
return (
|
|
<motion.div {...props}>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
} |