Closed wmertens closed 5 years ago
Can you provide a PR that would demonstrate how 1 would work in concert with HMR?
instanceOfSubclass instanceof ParentClass
is already true; I'm not sure what needs to change here.
The issues with HMR are that it breaks object identity, and it can't be fixed except in the HMR tool itself.
It can happen that some prop is actually an instance of a subclass of what is expected by
instanceOf
. For example, with HMR, some classes are wrapped.For these cases it would be nice if the prototype chain is followed.
I see two possibilities:
instanceOf
to checkObject.getPrototypeOf(value)
recursivelyThe nice thing about 1. is that it will fix spurious warnings when using HMR.