Skip to content

Commit

Permalink
fix(connect.js): forward right mapDispatchToProps
Browse files Browse the repository at this point in the history
Forward dispatch as-is when it
is not a function
  • Loading branch information
adrienharnay authored Feb 15, 2018
1 parent f4f406b commit 120ae68
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const easyConnect = injectProps => (
{},
);
}
: {};
: mapDispatchToProps;

return connect(mapStateToProps, modifiedMapDispatchToProps, ...otherArgs);
};
Expand Down Expand Up @@ -73,7 +73,9 @@ export default (...args) => (WrappedComponent) => {
};

getWrappedInstance = () =>
this.innerRef ? this.innerRef.getWrappedInstance() : null;
this.innerRef && this.innerRef.getWrappedInstance
? this.innerRef.getWrappedInstance()
: null;

render() {
const { ConnectedComponent } = this;
Expand Down

0 comments on commit 120ae68

Please sign in to comment.