Diagnosing AnimatePresence Animation Failures in FramerMotion: A Step‑by‑Step Guide
Identify why a component’s enter or exit animation fails in FramerMotion, with clear checks, code examples, and version verification.
29 Sept 2026, 11:37 UTC

Diagnosing AnimatePresence Animation Failures
When a component that should animate on mount or unmount disappears instantly or never appears, the symptom is a missing or broken transition animation. The root cause is usually an incorrect use of <AnimatePresence> or a layout change that prevents the exit animation from being captured.
Typical Symptoms
The element either stays on screen without the defined enter animation, disappears instantly, or shows a jittery exit. In the console you may see warnings such as “AnimatePresence: child element not found” or no warning at all.
Diagnostic Table
| Symptom | Likely Cause |
|---|---|
| Component never animates on mount | Missing <AnimatePresence> wrapper or wrong animate prop. |
| Component vanishes without exit animation | Wrapper present but exit variant duration shorter than transition time, or layout shift during exit. |
| Animation stutters or skips frames | Fast unmount in older FramerMotion (<9) or high frame‑rate exceeding default 60 fps. |
Step‑by‑Step Checks
- Verify the wrapper: Ensure the target element is inside
<AnimatePresence mode={...}>. The child must receive theanimateprop that matches the variant name. - Inspect variant definitions: Confirm that
enter,exitandtransitionvalues differ. Identical values cause the animation to be skipped.
Fixes Aligned with Findings
- Add
<AnimatePresence>around the component and setmode="wait"if you need the exit animation to finish before the component is removed. - Match the
transitionduration in the exit variant to thedurationyou defined for the animation. Example:
const variants = {
hidden: { opacity: 0, transition: { duration: 0.3 } },
visible: { opacity: 1, transition: { duration: 0.3 } },
exit: { opacity: 0, transition: { duration: 0.3, ease: "easeOut" } }
};
If you use layout mode, keep the element’s position and size stable while it exits. Sudden size changes trigger layout thrashing and can drop frames.
Escalation Criteria
If the animation still fails after correct wrapping and variant setup, check the library versions:
- Run
npm list framermotion(oryarn list framermotion) to see the installed version. Versions older than 9 have a known bug where fast unmounts ignore exit animations. - Upgrade to the latest stable release if you are on <9.0.0.
- Test the app in a non‑strict React environment (e.g., disable
React.StrictMode) to rule out double‑render issues that can miss exit frames.
Verification Steps
- Start the development server:
npm start. Ensure you have permission to run the script (typically your user account). - Trigger the component unmount (e.g., navigate away or toggle a state flag). Observe the console for any
AnimatePresencewarnings. - Inspect the DOM: look for the CSS transform or opacity change that corresponds to the
exitvariant. If the element disappears instantly, the exit animation was not captured.
Practical Check
After applying a fix, reload the page and watch the animation in the browser’s dev tools. Use the “Elements” panel to watch the opacity or transform properties change over the expected duration. If the change occurs within the defined duration and the console stays warning‑free, the issue is resolved.
Limitations & Risks
The guidance assumes FramerMotion ≥9 and React 18. Older versions may require additional configuration or a downgrade. Running the app in production without testing the unmount scenario can hide regressions. Always keep a backup of your component code before making structural changes, so you can revert if the animation behavior regresses.