Closed leny closed 7 years ago
It is very much intentional to allow one without a store attached, because that's how mapStoreToState
works (it's totally separate from the this.store
concept).
So yes, definitely a bug. And an easy fix, so thanks for pointing it out. I'll have it fixed in the next update.
Ok. Do you want me to submit a PR for that?
@leny - don't worry about it. I already got it fixed and will push the fix live soon.
Should now be fixed as of v6.1.0, which is now published on here, bower, npm, etc.
Hi,
I'm not really sure this is really a bug ; in a big project with React + Reflux, I've created a base component from which all my components inherits.
All works OK until I create a component with no store to listen to. By design, reflux is allowing this. But when the component calls its
componentWillUnmount
method, an Error is thrown because the property__storeunsubscribes__
isn't an Array (which breaks the for loop code here).The bug can be handled by adding a simple
this.stores = [];
in my base component, but I think this is probably a bug that we can address here in Reflux : if we can define a Reflux.Component with no store, thecomponentWillUnmount
method is broken (I can send a PR to fix that) ; if we can't define a Reflux.Component with no store, maybe we should raise an error or a warning?Thanks,