MCPcopy Create free account
hub / github.com/AlloyTeam/PhyTouch / createElementTypeChecker

Function createElementTypeChecker

transformjs/react/example/index.js:3957–3968  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3955 }
3956
3957 function createElementTypeChecker() {
3958 function validate(props, propName, componentName, location, propFullName) {
3959 var propValue = props[propName];
3960 if (!ReactElement.isValidElement(propValue)) {
3961 var locationName = ReactPropTypeLocationNames[location];
3962 var propType = getPropType(propValue);
3963 return new PropTypeError('Invalid ' + locationName + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
3964 }
3965 return null;
3966 }
3967 return createChainableTypeChecker(validate);
3968 }
3969
3970 function createInstanceTypeChecker(expectedClass) {
3971 function validate(props, propName, componentName, location, propFullName) {

Callers 1

index.jsFile · 0.85

Calls 1

Tested by

no test coverage detected