wcjohnson / redux-components

A component model for Redux state trees.
https://wcjohnson.github.io/redux-components
MIT License
4 stars 1 forks source link

Interoperabiliity between duplicate copies of redux-components library in a bundle #6

Open wcjohnson opened 7 years ago

wcjohnson commented 7 years ago

In large builds, multiple packages may depend on redux-components. This can cause duplicate copies to end up in a webpack bundle.

This, in turn, causes multiple instances of key objects like the ReduxComponent base class, which causes instanceof() to fail to properly detect ReduxComponents that come from another copy of the library.

The ultimate manifestation of this is cannot mount something that isn't an instance of ReduxComponent errors in dev invariant mode.

We should consider storing critical information on a global object, or perhaps using something like React 15's $$typeof symbol.