UNPKG

framer-motion

Version:

A simple and powerful JavaScript animation library

1 lines 956 B
{"version":3,"file":"unwrap-motion-component.mjs","sources":["../../../../src/motion/utils/unwrap-motion-component.ts"],"sourcesContent":["import { isMotionComponent } from \"./is-motion-component\"\nimport { motionComponentSymbol } from \"./symbol\"\n\n/**\n * Unwraps a `motion` component and returns either a string for `motion.div` or\n * the React component for `motion(Component)`.\n *\n * If the component is not a `motion` component it returns undefined.\n */\nexport function unwrapMotionComponent(\n component: React.ComponentType | string\n): React.ComponentType | string | undefined {\n if (isMotionComponent(component)) {\n return component[motionComponentSymbol as keyof typeof component]\n }\n\n return undefined\n}\n"],"names":[],"mappings":";;;AAGA;;;;;AAKG;AACG,SAAU,qBAAqB,CACjC,SAAuC,EAAA;AAEvC,IAAA,IAAI,iBAAiB,CAAC,SAAS,CAAC,EAAE;AAC9B,QAAA,OAAO,SAAS,CAAC,qBAA+C,CAAC,CAAA;KACpE;AAED,IAAA,OAAO,SAAS,CAAA;AACpB;;;;"}