UNPKG

956 BJavaScriptView Raw
1/**
2 * Copyright (c) 2013-present, Facebook, Inc.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8if (process.env.NODE_ENV !== 'production') {
9 var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
10 Symbol.for &&
11 Symbol.for('react.element')) ||
12 0xeac7;
13
14 var isValidElement = function(object) {
15 return typeof object === 'object' &&
16 object !== null &&
17 object.$$typeof === REACT_ELEMENT_TYPE;
18 };
19
20 // By explicitly using `prop-types` you are opting into new development behavior.
21 // http://fb.me/prop-types-in-prod
22 var throwOnDirectAccess = true;
23 module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
24} else {
25 // By explicitly using `prop-types` you are opting into new production behavior.
26 // http://fb.me/prop-types-in-prod
27 module.exports = require('./factoryWithThrowingShims')();
28}