Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Libraries/ReactIOS/verifyPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@ function verifyPropTypes(
if (!viewConfig) {
return; // This happens for UnimplementedView.
}

if (!component.propTypes) {
throw new Error(
'`' + (component.name || component.displayName) + '` has no propTypes defined`'
);
};

var nativeProps = viewConfig.nativeProps;
for (var prop in nativeProps) {
if (!component.propTypes[prop] &&
!View.propTypes[prop] &&
!ReactIOSStyleAttributes[prop] &&
(!nativePropsToIgnore || !nativePropsToIgnore[prop])) {
throw new Error(
'`' + component.displayName + '` has no propType for native prop `' +
'`' + (component.name || component.displayName) + '` has no propType for native prop `' +
viewConfig.uiViewClassName + '.' + prop + '` of native type `' +
nativeProps[prop].type + '`'
);
Expand Down