Skip to content
Merged
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
13 changes: 11 additions & 2 deletions src/isomorphic/classic/element/ReactElementValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,17 @@ function validatePropTypes(element) {
return;
}
var name = componentClass.displayName || componentClass.name;
if (componentClass.propTypes) {
checkReactTypeSpec(componentClass.propTypes, element.props, 'prop', name);

// ReactNative `View.propTypes` have been deprecated in favor of `ViewPropTypes`.
// In their place a temporary getter has been added with a deprecated warning message.
// Avoid triggering that warning during validation using the temporary workaround, __propTypesSecretDontUseThesePlease.
// TODO (bvaughn) Revert this particular change any time after April 1 ReactNative RC is tagged.
var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease === 'object'
? componentClass.__propTypesSecretDontUseThesePlease
: componentClass.propTypes;

if (propTypes) {
checkReactTypeSpec(propTypes, element.props, 'prop', name);
}
if (typeof componentClass.getDefaultProps === 'function') {
warning(
Expand Down