Skip to content

[BUG] - Possible AnimatePresence regression in 12.24.4 #3455

@joshuaslate

Description

@joshuaslate

Note: seems to be related to this prior regression (also related to refs, if I recall correctly): #3369

1. Read the FAQs 👇
I read them and I don't believe I'm encountering any of these issues.

2. Describe the bug

In 12.24.3, I've got no issues with the code in the sandbox (it handles enter/exit animations as expected). Once I update to a newer version, it seems like AnimatePresence is no longer handling exit animations. In my case, it's leaving my dialogs rendered on screen, even when their state is closed.

3. IMPORTANT: Provide a CodeSandbox reproduction of the bug

https://codesandbox.io/p/sandbox/qpkkkh

4. Steps to reproduce

Steps to reproduce the behavior:

  1. Wrap elements in AnimatePresence
  2. Add animation variants
  3. Attempt to change the presence state

5. Expected behavior

In this case, when a dialog's open/close state changes from open -> closed, I'd expect AnimatePresence to exit the dialog.

6. Video or screenshots

The sandbox should show it clearly.

7. Environment details

OS: MacOS
Browsers: FireFox, Chromium

This is in a single-page application with no SSR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions