Skip to content

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

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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