-
Notifications
You must be signed in to change notification settings - Fork 988
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
Report a warning when using props data as items. #82
Comments
After remove |
@insekkei would you be able to provide a more complete code sample or share a gist / jsfiddle? It's very hard for me to help you out based only on what you've provided so far, I'd need to see more. |
@clauderic The problem here is that when using redux the component may get re-rendered within the Since the Is there any reason the provided onSortEnd Callback from props is fired before the I think we should simply put that block at the end of the |
i'm having the same issue :/ anyone found the problem or the fix to this? |
@sag1v Read my comment.. In the
after the setState (or just to the end of the function)
Just like in my fork: https://github.com/ekrokowski/react-sortable-hoc/blob/51f2c4d3ac763639e66fbd6659cdd8c5fd568cbe/src/SortableContainer/index.js#L302 |
Hmm thanks man, but changing it feels awkward. Why isnt the aithor approve this change? Does it have any side effects? |
@ekrokowski |
Hey @ekrokowski, thanks for pointing that out. Just shipped |
Code:
Component.js:
Reducer:
Result:
warning.js:45 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 SortableList component.
The text was updated successfully, but these errors were encountered: