mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
RN: Simplify verifyPropTypes
Reviewed By: sahrens Differential Revision: D7893675 fbshipit-source-id: 74d1eff57201a2af4a12c39c4335e28ff9f14090
This commit is contained in:
committed by
Facebook Github Bot
parent
b549e364e0
commit
820673e707
@@ -25,7 +25,13 @@ const verifyPropTypes = require('verifyPropTypes');
|
||||
const invariant = require('fbjs/lib/invariant');
|
||||
const warning = require('fbjs/lib/warning');
|
||||
|
||||
import type {ComponentInterface} from 'verifyPropTypes';
|
||||
type ComponentInterface =
|
||||
| React$ComponentType<any>
|
||||
| $ReadOnly<{
|
||||
propTypes?: $ReadOnly<{
|
||||
[propName: string]: mixed,
|
||||
}>,
|
||||
}>;
|
||||
|
||||
type ExtraOptions = $ReadOnly<{|
|
||||
nativeOnly?: $ReadOnly<{
|
||||
@@ -115,13 +121,10 @@ const requireNativeComponent = (
|
||||
});
|
||||
|
||||
if (__DEV__) {
|
||||
if (componentInterface != null) {
|
||||
verifyPropTypes(
|
||||
componentInterface,
|
||||
viewConfig,
|
||||
extraConfig == null ? null : extraConfig.nativeOnly,
|
||||
);
|
||||
}
|
||||
verifyPropTypes(
|
||||
viewConfig,
|
||||
extraConfig == null ? null : extraConfig.nativeOnly,
|
||||
);
|
||||
}
|
||||
|
||||
if (!hasAttachedDefaultEventTypes) {
|
||||
|
||||
Reference in New Issue
Block a user