gaearon / react-deep-force-update

Force-updates React component tree recursively

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node.tag is never 2 for React v16.6 => never updates

wmertens opened this issue · comments

This pertains to v4 beta 13, which code is not to be found in this repo :(

the beta checks node.tag and only processes nodes where node.tag === 2. However, in React v16.6 it seems that almost all nodes are a 1.

Hence, no updates.

commented

I removed that check from all active branches. Who uses the 4 beta? I’m not sure what that is.

commented

I understand it’s on npm but I don’t remember working on that branch. It was likely somebody else. So I’m asking which project uses this.

Some proprietary projects over here use them, but I have ascertained that v2 works just as well now. I use it to propagate semi-fixed property changes, like the current language and the current location.

So maybe v4 should get a beta14 that prints a warning? I started using it when v1 nor v2 worked for me, and I just assumed that a higher number is better.

Alternatively, make the current version be v4 :)

I still think that deep-force-update has a place in the ecosystem, even with the Context API, because I'm reasoning that that API adds a bunch of listeners like Redux does?

I may be wrong, in which case it would probably be better that I migrate to Context.

hm, it sounds like you've been putting this library into production code? that sounds like quite a hack.

I've used it as a piece of react hot reloading support I've rolled for typescript+amd+requirejs, and it works great for it. It's useful because react code doesn't assume that code can change from under it, and so forcing updates is helpful for the hot reloading use case.