-
DescriptionSuppose I have a grid component wrapped in a framer const Grid = React.forwardRef<HTMLDivElement, GridProps>((props, ref) => {
const { children, config, ...rest } = props;
return (
<MotionConfig transition={config}>
<Base ref={ref} {...rest}>
{children}
</Base>
</MotionConfig>
);
});
Grid.displayName = "Grid";
export default Grid; I want all of my custom elements to be capable of receiving a config prop of type import type { Transition } from "framer-motion";
export default defineConfig({
utilities: {
extend: {
config: {
values: { type: Transition }, // <-- doesn't work, expected value received type
transform(value) {
return { config: value };
},
},
}) Link to Reproductionna Steps to reproduce
JS FrameworkReact (TS) Panda CSS Version^0.5.0 BrowserNo response Operating System
Additional InformationNo response |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
In the end, I will be able to use my grid component and define framer motion values: <Grid
w={120} // <-- panda props
bg="red.900" // <-- panda props
config={{ // <-- my prop defined generally for all panda components
duration: 0.14 // <-- define how components animate
}}
_hover={{
bg: "gray.500"
}}
>
stuff here
</Grid> |
Beta Was this translation helpful? Give feedback.
-
you can make your own component wrapping a factory with style props like this
|
Beta Was this translation helpful? Give feedback.
you can make your own component wrapping a factory with style props like this