Motion: [BUG] State update after AnimatePresence is unmouted

Created on 24 Jul 2019  路  6Comments  路  Source: framer/motion

Describe the bug

When an exit animation is running while the <AnimatePresence/> component itself gets unmounted, you get an Can't perform a React state update on an unmounted component error.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/nice-vaughan-wcr1z
  2. Click on "Toggle Content"
  3. While the box is disappearing, click on "Toggle Container"

Expected behavior
No state update should happen when the parent AnimatePresence is unmounted

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: latest
bug in progress

Most helpful comment

I think i am still running into this issue even at 1.7.

https://codesandbox.io/s/blissful-cache-9mmh7

All 6 comments

I think i am still running into this issue even at 1.7.

https://codesandbox.io/s/blissful-cache-9mmh7

+1

I believe this is still an issue on 2.0.0-beta.77

For anyone getting to this issue. It seems this was fixed in version: [2.6.14] at 2020-09-18.

According to the changelog:
_Fix memory leak error in AnimatePresence._

Here is the sandbox with the framer/motion version upgraded:
https://codesandbox.io/s/cool-grass-wfryu?file=/src/index.js

For anyone getting to this issue. It seems this was fixed in version: [2.6.14] at 2020-09-18.

It looks like that's indeed the the case. I've upgraded and no longer seeing those errors. Thanks for letting us know.

Was this page helpful?
0 / 5 - 0 ratings