diff options
Diffstat (limited to 'node_modules/react/lib/ReactElementValidator.js')
-rw-r--r-- | node_modules/react/lib/ReactElementValidator.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/node_modules/react/lib/ReactElementValidator.js b/node_modules/react/lib/ReactElementValidator.js index bfffb0b6a..470838a45 100644 --- a/node_modules/react/lib/ReactElementValidator.js +++ b/node_modules/react/lib/ReactElementValidator.js @@ -26,6 +26,7 @@ var checkReactTypeSpec = require('./checkReactTypeSpec'); var canDefineProperty = require('./canDefineProperty'); var getIteratorFn = require('./getIteratorFn'); var warning = require('fbjs/lib/warning'); +var lowPriorityWarning = require('./lowPriorityWarning'); function getDeclarationErrorAddendum() { if (ReactCurrentOwner.current) { @@ -166,7 +167,6 @@ function validatePropTypes(element) { } var ReactElementValidator = { - createElement: function (type, props, children) { var validType = typeof type === 'string' || typeof type === 'function'; // We warn in this case but don't throw. We expect the element creation to @@ -175,7 +175,7 @@ var ReactElementValidator = { if (typeof type !== 'function' && typeof type !== 'string') { var info = ''; if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) { - info += ' You likely forgot to export your component from the file ' + 'it\'s defined in.'; + info += ' You likely forgot to export your component from the file ' + "it's defined in."; } var sourceInfo = getSourceInfoErrorAddendum(props); @@ -187,7 +187,10 @@ var ReactElementValidator = { info += ReactComponentTreeHook.getCurrentStackAddendum(); + var currentSource = props !== null && props !== undefined && props.__source !== undefined ? props.__source : null; + ReactComponentTreeHook.pushNonStandardWarningStack(true, currentSource); process.env.NODE_ENV !== 'production' ? warning(false, 'React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', type == null ? type : typeof type, info) : void 0; + ReactComponentTreeHook.popNonStandardWarningStack(); } } @@ -225,7 +228,7 @@ var ReactElementValidator = { Object.defineProperty(validatedFactory, 'type', { enumerable: false, get: function () { - process.env.NODE_ENV !== 'production' ? warning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.') : void 0; + lowPriorityWarning(false, 'Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.'); Object.defineProperty(this, 'type', { value: type }); @@ -246,7 +249,6 @@ var ReactElementValidator = { validatePropTypes(newElement); return newElement; } - }; module.exports = ReactElementValidator;
\ No newline at end of file |