-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Maximum update depth exceeded on 8.0.0 #166
Comments
Will need a reproduction to proceed with any debugging. |
The same problem with useAutoAnimate on: |
Can you create a stackblitz reproduction? |
I think it has to do with the optional configuration. |
Yes, I try it |
Just wanted to mention I'm getting this too when trying to add an optional plugin. Doesn't occur when using plain react: 18.2.0 Edit: @justin-schroeder Updated with stackblitz showing the error. (link) |
The same here, fixed by removing params |
Memoizing the optional configuration (or making the object reference constant) seems to fix the issue on my end. |
If anyone wants to submit a PR to fix this I’d happily merge/publish it. Otherwise, this will be at the mercy of whenever I get the time to do another sprint on AutoAnimate — probably a few weeks aways. |
Making version of the auto-animate down to 0.7.0 resolves the problem on my end. I also do not use the params fed to constructor. |
If anyone needed an example of how to memoize an optional configuration and see it working: |
Fix Max update depth exceeded with useAutoAnimate
Any release planned? |
@verheyenkoen You might already know this, but figured I'd post this in case someone else needed this bug fix before their next release. You can choose to install the library from the master branch of this repository instead of a release version. Run the following command. It will install build and install @formkit/auto-animate from the specified branch. If you already have @formkit/auto-animate in your package.json that's fine, it'll update it to point to this master branch.
I believe this should work with yarn and pnpm as well. Note: Notice I didn't type |
This fix is now published in 0.8.1 |
I am not completely sure that the merged fix represents the intended behaviour. With the new change, it will no longer be possible to systematically update the options used by autoAnimate, and only the options set when the component was mounted using useAutoAnimate will always be used. Maybe these are niche cases, but it becomes impossible1 to change the easing or the duration systematically. Footnotes
|
This problem remains
|
Not working for me on Next.js with 0.8.2 still, using NextUI\s Listbox. |
Same problem here. Using React 18.3.1 |
Same problem here, using Next.js 14.2.3 |
Getting the following error in V8.0.0
Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
Running on NextJS
The text was updated successfully, but these errors were encountered: