MCPcopy Create free account
hub / github.com/Lobos/react-ui / createUnionTypeChecker

Function createUnionTypeChecker

docs/lib/react.js:12723–12742  ·  view source on GitHub ↗
(arrayOfTypeCheckers)

Source from the content-addressed store, hash-verified

12721}
12722
12723function createUnionTypeChecker(arrayOfTypeCheckers) {
12724 if (!Array.isArray(arrayOfTypeCheckers)) {
12725 return createChainableTypeChecker(function () {
12726 return new Error('Invalid argument supplied to oneOfType, expected an instance of array.');
12727 });
12728 }
12729
12730 function validate(props, propName, componentName, location, propFullName) {
12731 for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
12732 var checker = arrayOfTypeCheckers[i];
12733 if (checker(props, propName, componentName, location, propFullName) == null) {
12734 return null;
12735 }
12736 }
12737
12738 var locationName = ReactPropTypeLocationNames[location];
12739 return new Error('Invalid ' + locationName + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
12740 }
12741 return createChainableTypeChecker(validate);
12742}
12743
12744function createNodeChecker() {
12745 function validate(props, propName, componentName, location, propFullName) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…