Open oskarhane opened 7 years ago
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.
mapDispatchToProps
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.
let mapDispatchToProps = (d, p = {}) => {
let mapDispatchToProps = (d, p) => {
I'm trying to figure out what could cause this, no luck so far.
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 = {}) => {
tolet mapDispatchToProps = (d, p) => {
it works as expected.