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

Error when updating state inside onDragStart #617

Closed
ntelkedzhiev opened this issue Jul 4, 2018 · 9 comments
Closed

Error when updating state inside onDragStart #617

ntelkedzhiev opened this issue Jul 4, 2018 · 9 comments

Comments

@ntelkedzhiev
Copy link

I'm calling setState inside onDragStart and I'm getting the following error:

Error: Invariant failed: Attempting to move in an unsupported phase PREPARING

What version of React are you using?

16.3.2

What version of react-beautiful-dnd are you running?

8.0.1

What browser are you using?

Chrome

@alexreardon
Copy link
Collaborator

alexreardon commented Jul 4, 2018 via email

@ntelkedzhiev
Copy link
Author

ntelkedzhiev commented Jul 6, 2018

Thank you! @alexreardon

@alexreardon
Copy link
Collaborator

All good for you now?

@ntelkedzhiev
Copy link
Author

ntelkedzhiev commented Jul 10, 2018

I now get an error when I try to update the state so that isDropDisabled is set to true (still inside onDragStart).

Error: Trying to set droppable isEnabled to true but it is already true.

@alexreardon
Copy link
Collaborator

Can you please post an independent example? I am keen to resolve this

@ntelkedzhiev
Copy link
Author

https://codesandbox.io/s/vm528x79w3

@alexreardon
Copy link
Collaborator

I have a fix - PR incoming

@ntelkedzhiev
Copy link
Author

Works fine now! Thanks once again.

@alexreardon
Copy link
Collaborator

alexreardon commented Jul 11, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants