react-immutable-proptypes icon indicating copy to clipboard operation
react-immutable-proptypes copied to clipboard

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

Open joncursi opened this issue 8 years ago • 1 comments

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?

joncursi avatar Jan 03 '17 13:01 joncursi

Has anybody found a solution/workaround for this?

alexmcmillan avatar Oct 03 '17 01:10 alexmcmillan