HurricaneJames / react-immutable-proptypes

PropType validators that work with Immutable.js.
MIT License
641 stars 46 forks source link

[oneOfType]: Failed prop type: checker.apply is not a function #47

Closed joncursi closed 7 years ago

joncursi commented 7 years ago

There is no IPT equivalent of PropTypes.oneOfType. The following code is therefore, unfortunately, invalid:

PropTypes.oneOfType([
  ImmutablePropTypes.contains({
    ...
  }),
  ImmutablePropTypes.contains({
    ...
  }),
  ImmutablePropTypes.contains({
    ...
  }),
]);

oneOfType has no idea how to interpret ImmutablePropTypes, so it throws the following warning:

Warning: Failed prop type: checker.apply is not a function

joncursi commented 7 years ago

False alarm! I had an issue within my ImmutablePropTypes.contains({ ... }) declaration, sorry bout that!