From fdf06f9f834e766f26961ab4dc790a286c6b1722 Mon Sep 17 00:00:00 2001 From: Sammy Saglam Date: Sat, 31 Mar 2018 16:49:39 +0200 Subject: [PATCH] fixed: load react's dev prop-types instead of the prod empty one --- index.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 76cb664..295b7b2 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,21 @@ -var PropTypes = require('../prop-types'); +// ------------------------------------------------ +// load original React prop-types +// ------------------------------------------------ +var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + +var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; +}; +var throwOnDirectAccess = true; +var PropTypes = require('../prop-types/factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess); +// ------------------------------------------------ +// ------------------------------------------------ +// ------------------------------------------------ var AxePropTypes = {};