Skip to content
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

[Bug] Upload.Dragger called setState() when it was unmounted and got a React Warning #5162

Closed
mdluo opened this issue Mar 3, 2017 · 1 comment

Comments

@mdluo
Copy link

mdluo commented Mar 3, 2017

Environment

  • antd version: 2.7.4

What did you do? Please provide steps to re-produce your problem.

Unmounted the Upload.Dragger component when a customRequest event was triggered

What happen?

Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the Upload component.

image

Where the problem is

https://github.com/ant-design/ant-design/blob/master/components/upload/index.tsx#L217

Possible solution

https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html

@mdluo mdluo changed the title [Bug] Upload.Dragger called setState() on when it was unmounted and got a React Warning [Bug] Upload.Dragger called setState() when it was unmounted and got a React Warning Mar 3, 2017
@afc163 afc163 closed this as completed in a82ab5f Mar 3, 2017
@lock
Copy link

lock bot commented May 2, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant