Check input and textarea propTypes only in DEV
Ben Alpert committed
Sep 15, 2015 at 21:46 UTC
65370ff7520c6daddd729710697873291662dee4
2 files changed
+14
-10
src/renderers/dom/client/wrappers/ReactDOMInput.js
+7
-5
@@ -61,11 +61,13 @@ var ReactDOMInput = {
61
},
62
63
mountWrapper: function(inst, props) {
64
- LinkedValueUtils.checkPropTypes(
65
- 'input',
66
- props,
67
- inst._currentElement._owner
68
- );
64
+ if (__DEV__) {
65
+ LinkedValueUtils.checkPropTypes(
66
+ 'input',
67
+ props,
68
+ inst._currentElement._owner
69
+ );
70
+ }
71
72
var defaultValue = props.defaultValue;
73
inst._wrapperState = {
src/renderers/dom/client/wrappers/ReactDOMTextarea.js
+7
-5
@@ -61,11 +61,13 @@ var ReactDOMTextarea = {
61
},
62
63
mountWrapper: function(inst, props) {
64
- LinkedValueUtils.checkPropTypes(
65
- 'textarea',
66
- props,
67
- inst._currentElement._owner
68
- );
64
+ if (__DEV__) {
65
+ LinkedValueUtils.checkPropTypes(
66
+ 'textarea',
67
+ props,
68
+ inst._currentElement._owner
69
+ );
70
+ }
71
72
var defaultValue = props.defaultValue;
73
// TODO (yungsters): Remove support for children content in <textarea>.