Skip to content

Zombie child errors when dispatching actions with keyboard shortcuts #286

Closed Answered by dai-shi
martonlanga asked this question in Q&A
Discussion options

You must be logged in to vote

Error reproduced.

This is reproducible only when we use keyboards without using mouse for several clicks.
So, what's happening is it tries to render child components before the parent, with rapid dispatch invocation.
To fix this on your end is to wrap the dispatch with batchedUpdates.
Here's the modified one: https://codesandbox.io/s/app-tab-cell-forked-poxow

The reason it doesn't repro with buttons is React does it internally.
I don't know why we can't repro after some clicks.

For reference, React-Redux exposes batch api.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@martonlanga
Comment options

@Tirzono
Comment options

@dai-shi
Comment options

@martonlanga
Comment options

Answer selected by martonlanga
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants