preact-redux icon indicating copy to clipboard operation
preact-redux copied to clipboard

Don't overwrite passed props to mapDispatchToProps with the default

Open oskarhane opened this issue 8 years ago • 1 comments

I found an unexpected behavior when defining second argument received by mapDispatchToProps to have a default value. The default value is always passed to it, even though other props are defined on the component.

I created a test to demonstrate it: https://github.com/oskarhane/preact-redux/commit/b0a2b89b54a0061e760575070db15350f115e68c

If the default is removed: let mapDispatchToProps = (d, p = {}) => { to let mapDispatchToProps = (d, p) => { it works as expected.

oskarhane avatar Mar 20 '17 16:03 oskarhane

I'm trying to figure out what could cause this, no luck so far.

developit avatar Mar 21 '17 15:03 developit