developit / developit/preact-redux

Don't overwrite passed props to mapDispatchToProps with the default

Open
#11 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
285
Forks
26
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.