Skip to content

mapOf(contains()) throws warning #56

@turnerhayes

Description

@turnerhayes

The problem seems like #23 but I'm still seeing it; my propType is:

payments: ImmutablePropTypes.mapOf(
      ImmutablePropTypes.contains({
        paidDate: PropTypes.oneOfType([
          PropTypes.number,
          PropTypes.instanceOf(Date),
        ]).isRequired,
        paidAmount: PropTypes.number.isRequired,
      }),
      PropTypes.number
    )

I get the following warning:

Invalid prop `payments[0]` of type `array` supplied to `MyComponent`, expected an Immutable.js Iterable

As mentioned in the aforementioned issue, it seems to be coming from the values being converted to arrays.

My react-immutable-proptypes version is 2.1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions