Skip to content

Warning: Invalid argument supplied to oneOf, expected an instance of array. #46

@joncursi

Description

@joncursi

There seems to be no true IPT equivalent of oneOf, which is problematic if you want to check that a prop is an exact match for an immutable map that exists in a constant immutable list.

const COUNTRIES = [
  {...},
  {...},
  {...},
  {...},
  {...},
  {...},
];

const IMMUTABLE_COUNTRIES = Immutable.fromJS(
  COUNTRIES
);

var countryShapeImmutable = React.PropTypes.oneOf(
  IMMUTABLE_COUNTRIES // fails
);

ExceptionsManager.js:71Warning: Invalid argument supplied to oneOf, expected an instance of array.

Is there a way to check for a specific immutable country here, using immutable proptypes?

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