framer-motion 12.24.4 → 12.24.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js
CHANGED
|
@@ -124,7 +124,13 @@ function PopChild({ children, isPresent, anchorX, root }) {
|
|
|
124
124
|
right: 0,
|
|
125
125
|
});
|
|
126
126
|
const { nonce } = React.useContext(featureBundle.MotionConfigContext);
|
|
127
|
-
|
|
127
|
+
/**
|
|
128
|
+
* In React 19, refs are passed via props.ref instead of element.ref.
|
|
129
|
+
* We check props.ref first (React 19) and fall back to element.ref (React 18).
|
|
130
|
+
*/
|
|
131
|
+
const childRef = children.props?.ref ??
|
|
132
|
+
children?.ref;
|
|
133
|
+
const composedRef = useComposedRefs(ref, childRef);
|
|
128
134
|
/**
|
|
129
135
|
* We create and inject a style block so we can apply this explicit
|
|
130
136
|
* sizing in a non-destructive manner by just deleting the style block.
|