Closed zcaudate closed 3 years ago
Hello @zcaudate, this is unfortunate indeed. But you seem to have a better understanding of the issue than I have currently and thus I was wondering whether you would like to attempt a PR to fix the problem, maybe by upgrading the underlying reconciler?
@Yomguithereal Hahaha. No, not at all. That was from one of the the maintainers of the redux project. I'm coming in to react from vue so am doing some simple projects to better understand the ecosystem.
Hiya! Yeah, the issue here is that react-blessed
has a dependency on "react-reconciler": "^0.20.4"
. Per my investigation, that version of react-reconciler
has a bug in how it checks for running passive effects, and this is causing React-Redux to run a subscription cleanup when it shouldn't.
As of react-reconciler@0.21.0
, that chunk of the code has been completely rewritten.
The current version is react-reconciler@0.26.1
.
Per that SO discussion, there's a couple other tweaks that we should make on the React-Redux side as well, but the real bugfix is to upgrade react-blessed
to use the latest version of react-reconciler
. I'm not sure how much additional effort might be needed to update the host config after bumping the dependency version, though.
@markerikson is it just as simple as upgrading the react-reconciler
version?
I'd like to give it a go.
I did some quick and dirty (using immer instead of redux)
Maybe this is related but I found that when I'm using an async timer to switch state, the UI updates once and does not update again
@Yomguithereal: are there any instructions for compiling this library?
@zcaudate I am not sure to precisely know what you mean by "compiling" in this context. Just install deps with npm i
, run the units tests with npm test
and, most importantly, try to run some examples using npm run demo
to see if what you did still works.
Sweet I'll take a look in the next couple of days
Just for completeness' sake with the counter examples:
I was hoping to get snake and pong working but the async animation thing not working kinda put a damper on it.
v0.7.0 should have fixed this issue? Can someone confirm and close the issue or ask me to do it please?
I just tried updating the bug repro counter project I was given, and it does appear to be updating correctly now. So, I'm gonna give a thumbs-up.
yep. it's working for me too!
Copying from the response to a question I asked here
react-blessed
andreact-reconciler
that is causinguseEffect
cleanup functions to be run when they shouldn't be. This may be due toreact-blessed
keeping around thisrunningEffects
array, or it may be due to something odd in this specific version ofreact-reconciler
. Either way, the root cause of the behavior you're seeing is thatProvider
is unsubscribed when it shouldn't be because it was callinguseEffect
, and then having its cleanup function run when you dispatched a new Redux action and queued a UI update. That caused a flush of passive effects, which hits this bit:passiveEffectCallbackHandle
isundefined
, notnull
, so it's erroneously trying to callcancelPassiveEffects()
. That seems like a bug in this version ofreact-reconciler
.react-blessed
to try to clean up itsrunningEffects
array, which nukes the effect handler