Skip to content

Commit fdf06f9

Browse files
author
Sammy Saglam
committed
fixed: load react's dev prop-types instead of the prod empty one
1 parent 77b4be2 commit fdf06f9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

index.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
var PropTypes = require('../prop-types');
1+
// ------------------------------------------------
2+
// load original React prop-types
3+
// ------------------------------------------------
4+
var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&
5+
Symbol.for &&
6+
Symbol.for('react.element')) ||
7+
0xeac7;
8+
9+
var isValidElement = function(object) {
10+
return typeof object === 'object' &&
11+
object !== null &&
12+
object.$$typeof === REACT_ELEMENT_TYPE;
13+
};
14+
var throwOnDirectAccess = true;
15+
var PropTypes = require('../prop-types/factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);
16+
// ------------------------------------------------
17+
// ------------------------------------------------
18+
// ------------------------------------------------
219

320
var AxePropTypes = {};
421

0 commit comments

Comments
 (0)