framer-motion 12.24.6 → 12.24.8
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 +9 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/dom.js +1 -1
- package/dist/es/components/AnimatePresence/index.mjs +9 -0
- package/dist/es/components/AnimatePresence/index.mjs.map +1 -1
- package/dist/framer-motion.dev.js +31 -0
- package/dist/framer-motion.js +1 -1
- package/dist/projection.d.ts +912 -0
- package/dist/size-rollup-animate.js +1 -1
- package/dist/size-rollup-animate.js.map +1 -1
- package/dist/size-rollup-dom-animation-assets.js +1 -1
- package/dist/size-rollup-dom-animation.js +1 -1
- package/dist/size-rollup-dom-max-assets.js +1 -1
- package/dist/size-rollup-dom-max.js +1 -1
- package/dist/size-rollup-m.js.map +1 -1
- package/dist/size-rollup-motion.js +1 -1
- package/dist/size-rollup-motion.js.map +1 -1
- package/dist/size-rollup-scroll.js.map +1 -1
- package/package.json +4 -3
package/dist/cjs/index.js
CHANGED
|
@@ -296,6 +296,10 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
|
|
|
296
296
|
* Track which exiting children have finished animating out.
|
|
297
297
|
*/
|
|
298
298
|
const exitComplete = featureBundle.useConstant(() => new Map());
|
|
299
|
+
/**
|
|
300
|
+
* Track which components are currently processing exit to prevent duplicate processing.
|
|
301
|
+
*/
|
|
302
|
+
const exitingComponents = React.useRef(new Set());
|
|
299
303
|
/**
|
|
300
304
|
* Save children to render as React state. To ensure this component is concurrent-safe,
|
|
301
305
|
* we check for exiting children via an effect.
|
|
@@ -317,6 +321,7 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
|
|
|
317
321
|
}
|
|
318
322
|
else {
|
|
319
323
|
exitComplete.delete(key);
|
|
324
|
+
exitingComponents.current.delete(key);
|
|
320
325
|
}
|
|
321
326
|
}
|
|
322
327
|
}, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
|
|
@@ -368,6 +373,10 @@ const AnimatePresence = ({ children, custom, initial = true, onExitComplete, pre
|
|
|
368
373
|
: presentChildren === renderedChildren ||
|
|
369
374
|
presentKeys.includes(key);
|
|
370
375
|
const onExit = () => {
|
|
376
|
+
if (exitingComponents.current.has(key)) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
exitingComponents.current.add(key);
|
|
371
380
|
if (exitComplete.has(key)) {
|
|
372
381
|
exitComplete.set(key, true);
|
|
373
382
|
}
|