You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use this module in patch mode in my application I get runtime errors. Presumably this is because my mapStateToProps is not passing in the correct state.
I seemed to be able to fix this by no longer passing in a mapStateToPropsFactory into connect.
Note: in advanced scenarios where you need more control over the rendering performance, mapStateToProps() can also return a function. In this case, that function will be used as mapStateToProps() for a particular component instance. This allows you to do per-instance memoization. You can refer to #279 and the tests it adds for more details. Most apps never need this.
Am I mistaken that this is not supported?
I created the issue here rather than on the other repository, because I have an application which has partial usage of reselect selectors in some places but there are some problems with how these were written. I was going to use check to find out what was broken, but also decided to try patch and it did not work out-of-the-box. I don't think it's as 'advanced' as the react-redux documentation says: when you are using reselect you create selector factories quite frequently...
Maybe you be handling the situations in which mapStateToProps is a factory of mapStateToProps functions here?
Edit: I also noticed that in check mode, I get a lot of warnings about object spreading, which presumably means this is only sometimes working?
Edit 2: There are a couple of times in which check isn't working presumably due to the factory problem, since the "result is not equal at [resultFunc,recomputations,resetRecomputations], while should be equal". Presume this is related to the main issue?
The text was updated successfully, but these errors were encountered:
sebinsua
changed the title
Does memoize-state handle situations in which mapStateToProps was a factory?
Does memoize-state handle situations in which mapStateToProps is a factory?
Mar 28, 2018
When I use this module in
patch
mode in my application I get runtime errors. Presumably this is because mymapStateToProps
is not passing in the correct state.I seemed to be able to fix this by no longer passing in a
mapStateToPropsFactory
intoconnect
.To quote the
react-redux
API:Am I mistaken that this is not supported?
I created the issue here rather than on the other repository, because I have an application which has partial usage of
reselect
selectors in some places but there are some problems with how these were written. I was going to usecheck
to find out what was broken, but also decided to trypatch
and it did not work out-of-the-box. I don't think it's as 'advanced' as the react-redux documentation says: when you are usingreselect
you create selector factories quite frequently...Maybe you be handling the situations in which
mapStateToProps
is a factory ofmapStateToProps
functions here?Edit: I also noticed that in
check
mode, I get a lot of warnings about object spreading, which presumably means this is only sometimes working?Edit 2: There are a couple of times in which
check
isn't working presumably due to the factory problem, since the "result is not equal at [resultFunc,recomputations,resetRecomputations], while should be equal". Presume this is related to the main issue?The text was updated successfully, but these errors were encountered: