Skip to content

API example error related to ownProps #1055

Closed
@carloluis

Description

@carloluis

The API doc. section: The arity of mapStateToProps and mapDispatchToProps determines whether they receive ownProps has some code examples, but the console.log hint on the ownProps in second code excerpt is wrong. It says undefined instead of the empty object used as default value for the parameter.

I'll create a PR with this minor update/fix:

const mapStateToProps = (state, ownProps = {}) => {
  console.log(state); // state
-  console.log(ownProps); // undefined
+  console.log(ownProps); // {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions