diff --git a/Libraries/ReactIOS/verifyPropTypes.js b/Libraries/ReactIOS/verifyPropTypes.js index 6ee23cda8..5fd3ea1b8 100644 --- a/Libraries/ReactIOS/verifyPropTypes.js +++ b/Libraries/ReactIOS/verifyPropTypes.js @@ -22,6 +22,13 @@ function verifyPropTypes( if (!viewConfig) { return; // This happens for UnimplementedView. } + var componentName = component.name || component.displayName; + if (!component.propTypes) { + throw new Error( + '`' + componentName + '` has no propTypes defined`' + ); + } + var nativeProps = viewConfig.nativeProps; for (var prop in nativeProps) { if (!component.propTypes[prop] && @@ -29,9 +36,9 @@ function verifyPropTypes( !ReactNativeStyleAttributes[prop] && (!nativePropsToIgnore || !nativePropsToIgnore[prop])) { throw new Error( - '`' + component.displayName + '` has no propType for native prop `' + + '`' + componentName + '` has no propType for native prop `' + viewConfig.uiViewClassName + '.' + prop + '` of native type `' + - nativeProps[prop].type + '`' + nativeProps[prop] + '`' ); } }