diff --git a/packages/framer-motion/src/components/AnimatePresence/PopChild.tsx b/packages/framer-motion/src/components/AnimatePresence/PopChild.tsx index f34e757ffb..9dabc11c81 100644 --- a/packages/framer-motion/src/components/AnimatePresence/PopChild.tsx +++ b/packages/framer-motion/src/components/AnimatePresence/PopChild.tsx @@ -72,11 +72,9 @@ export function PopChild({ children, isPresent, anchorX, root }: Props) { right: 0, }) const { nonce } = useContext(MotionConfigContext) - const composedRef = useComposedRefs( - ref, - (children as { ref?: React.Ref })?.ref - ) - + const childRef = (children as any)?.ref ?? (children as any)?.props?.ref; + const composedRef = useComposedRefs(ref, childRef); + /** * We create and inject a style block so we can apply this explicit * sizing in a non-destructive manner by just deleting the style block.