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

Store change (container render) is still inside a dispatch #5

Open
Klaasvaak opened this issue May 13, 2016 · 0 comments
Open

Store change (container render) is still inside a dispatch #5

Klaasvaak opened this issue May 13, 2016 · 0 comments

Comments

@Klaasvaak
Copy link

I got the following error in my webapp:
Uncaught Error: Invariant Violation: Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.

While debugging this I noticed that a render, triggered by a store change, is still within a dispatch. Is this as it should work? The problem here is that when rendering nested AltContainers and fetching data in the compomentWillMount hooks with an action this will cause: Uncaught Error: Invariant Violation: Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.

I changed altSetState to use a nextTick. But I'm not sure if that is the way to go. But it does fix the error.

For now I will defer my actions called in all compomentWillMount hooks within an AltContainer.

Does this make sense?

@Klaasvaak Klaasvaak changed the title Store change is still inside a dispatch Store change (container render) is still inside a dispatch May 13, 2016
prcolaco pushed a commit to decentrawise/alt-container that referenced this issue Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant