Closed robinvdvleuten closed 6 years ago
Hmm - doesn't this fail to bind the action creators to dispatch()
?
Nope I always use it this way in my projects and never had a problem with it. It is even mentioned in the redux documentation;
If an object is passed, each function inside it is assumed to be a Redux action creator. An object with the same function names, but with every action creator wrapped into a dispatch call so they may be invoked directly, will be merged into the component’s props.
Seems to work for me
Update: I've been informed actions are bound automatically when an object is passed. No spread needed!
I have removed the bindActions util and just used object spread directly to decrease the filesize even more :)