Skip to content

Connect doesn't warn if same property is sent from both parent and state #499

@ynonp

Description

@ynonp

The default merge method in connect:

const defaultMergeProps = (stateProps, dispatchProps, parentProps) => ({
  ...parentProps,
  ...stateProps,
  ...dispatchProps
})

Will just overwrite existing parent props with state props when same key is used.

IMHO it'd be better to show a warning to console, saving developers debugging time & effort

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions