react 0.9.0-rc1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/lib/AutoFocusMixin.js +1 -1
  2. package/lib/CSSCore.js +1 -1
  3. package/lib/CSSProperty.js +1 -1
  4. package/lib/CSSPropertyOperations.js +1 -1
  5. package/lib/ChangeEventPlugin.js +1 -1
  6. package/lib/ClientReactRootIndex.js +1 -1
  7. package/lib/CompositionEventPlugin.js +1 -1
  8. package/lib/DOMChildrenOperations.js +1 -1
  9. package/lib/DOMProperty.js +1 -1
  10. package/lib/DOMPropertyOperations.js +1 -1
  11. package/lib/Danger.js +1 -1
  12. package/lib/DefaultDOMPropertyConfig.js +7 -1
  13. package/lib/DefaultEventPluginOrder.js +1 -1
  14. package/lib/EnterLeaveEventPlugin.js +1 -1
  15. package/lib/EventConstants.js +1 -1
  16. package/lib/EventPluginHub.js +3 -1
  17. package/lib/EventPluginRegistry.js +23 -2
  18. package/lib/EventPluginUtils.js +1 -1
  19. package/lib/EventPropagators.js +1 -1
  20. package/lib/ExecutionEnvironment.js +1 -1
  21. package/lib/LinkedStateMixin.js +1 -1
  22. package/lib/LinkedValueUtils.js +1 -1
  23. package/lib/MobileSafariClickEventPlugin.js +1 -1
  24. package/lib/PooledClass.js +1 -1
  25. package/lib/React.js +2 -2
  26. package/lib/ReactCSSTransitionGroup.js +1 -1
  27. package/lib/ReactCSSTransitionGroupChild.js +1 -1
  28. package/lib/ReactChildren.js +4 -4
  29. package/lib/ReactComponent.js +1 -1
  30. package/lib/ReactComponentBrowserEnvironment.js +1 -1
  31. package/lib/ReactComponentEnvironment.js +1 -1
  32. package/lib/ReactCompositeComponent.js +1 -1
  33. package/lib/ReactContext.js +1 -1
  34. package/lib/ReactCurrentOwner.js +1 -1
  35. package/lib/ReactDOM.js +1 -1
  36. package/lib/ReactDOMButton.js +1 -1
  37. package/lib/ReactDOMComponent.js +1 -1
  38. package/lib/ReactDOMForm.js +1 -1
  39. package/lib/ReactDOMIDOperations.js +1 -1
  40. package/lib/ReactDOMImg.js +1 -1
  41. package/lib/ReactDOMInput.js +1 -1
  42. package/lib/ReactDOMOption.js +1 -1
  43. package/lib/ReactDOMSelect.js +1 -1
  44. package/lib/ReactDOMSelection.js +1 -1
  45. package/lib/ReactDOMTextarea.js +1 -1
  46. package/lib/ReactDefaultBatchingStrategy.js +1 -1
  47. package/lib/ReactDefaultInjection.js +1 -1
  48. package/lib/ReactDefaultPerf.js +1 -1
  49. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  50. package/lib/ReactErrorUtils.js +1 -1
  51. package/lib/ReactEventEmitter.js +3 -1
  52. package/lib/ReactEventEmitterMixin.js +1 -1
  53. package/lib/ReactEventTopLevelCallback.js +56 -16
  54. package/lib/ReactInjection.js +1 -1
  55. package/lib/ReactInputSelection.js +1 -1
  56. package/lib/ReactInstanceHandles.js +1 -1
  57. package/lib/ReactLink.js +1 -1
  58. package/lib/ReactMarkupChecksum.js +1 -1
  59. package/lib/ReactMount.js +1 -1
  60. package/lib/ReactMountReady.js +1 -1
  61. package/lib/ReactMultiChild.js +1 -1
  62. package/lib/ReactMultiChildUpdateTypes.js +1 -1
  63. package/lib/ReactOwner.js +1 -1
  64. package/lib/ReactPerf.js +1 -1
  65. package/lib/ReactPropTransferer.js +1 -1
  66. package/lib/ReactPropTypeLocationNames.js +1 -1
  67. package/lib/ReactPropTypeLocations.js +1 -1
  68. package/lib/ReactPropTypes.js +19 -19
  69. package/lib/ReactPutListenerQueue.js +1 -1
  70. package/lib/ReactReconcileTransaction.js +1 -1
  71. package/lib/ReactRootIndex.js +1 -1
  72. package/lib/ReactServerRendering.js +1 -1
  73. package/lib/ReactStateSetters.js +1 -1
  74. package/lib/ReactTestUtils.js +394 -0
  75. package/lib/ReactTextComponent.js +1 -1
  76. package/lib/ReactTransitionChildMapping.js +1 -1
  77. package/lib/ReactTransitionEvents.js +1 -1
  78. package/lib/ReactTransitionGroup.js +1 -1
  79. package/lib/ReactUpdates.js +1 -1
  80. package/lib/ReactWithAddons.js +6 -1
  81. package/lib/SelectEventPlugin.js +1 -1
  82. package/lib/ServerReactRootIndex.js +1 -1
  83. package/lib/SimpleEventPlugin.js +1 -1
  84. package/lib/SyntheticClipboardEvent.js +1 -1
  85. package/lib/SyntheticCompositionEvent.js +1 -1
  86. package/lib/SyntheticDragEvent.js +1 -1
  87. package/lib/SyntheticEvent.js +1 -1
  88. package/lib/SyntheticFocusEvent.js +1 -1
  89. package/lib/SyntheticKeyboardEvent.js +1 -1
  90. package/lib/SyntheticMouseEvent.js +1 -1
  91. package/lib/SyntheticTouchEvent.js +1 -1
  92. package/lib/SyntheticUIEvent.js +1 -1
  93. package/lib/SyntheticWheelEvent.js +1 -1
  94. package/lib/Transaction.js +1 -1
  95. package/lib/ViewportMetrics.js +1 -1
  96. package/lib/accumulate.js +1 -1
  97. package/lib/adler32.js +1 -1
  98. package/lib/cloneWithProps.js +1 -1
  99. package/lib/containsNode.js +1 -1
  100. package/lib/copyProperties.js +1 -1
  101. package/lib/createArrayFrom.js +1 -1
  102. package/lib/createFullPageComponent.js +1 -1
  103. package/lib/createNodesFromMarkup.js +1 -1
  104. package/lib/createObjectFrom.js +1 -1
  105. package/lib/cx.js +1 -1
  106. package/lib/dangerousStyleValue.js +1 -1
  107. package/lib/emptyFunction.js +1 -1
  108. package/lib/escapeTextForBrowser.js +1 -1
  109. package/lib/flattenChildren.js +1 -1
  110. package/lib/forEachAccumulated.js +1 -1
  111. package/lib/getActiveElement.js +1 -1
  112. package/lib/getEventKey.js +1 -1
  113. package/lib/getEventTarget.js +1 -1
  114. package/lib/getMarkupWrap.js +1 -1
  115. package/lib/getNodeForCharacterOffset.js +1 -1
  116. package/lib/getReactRootElementInContainer.js +1 -1
  117. package/lib/getTextContentAccessor.js +1 -1
  118. package/lib/getUnboundedScrollPosition.js +1 -1
  119. package/lib/hyphenate.js +1 -1
  120. package/lib/invariant.js +8 -8
  121. package/lib/isEventSupported.js +1 -1
  122. package/lib/isNode.js +1 -1
  123. package/lib/isTextInputElement.js +1 -1
  124. package/lib/isTextNode.js +1 -1
  125. package/lib/joinClasses.js +1 -1
  126. package/lib/keyMirror.js +1 -1
  127. package/lib/keyOf.js +1 -1
  128. package/lib/memoizeStringOnly.js +1 -1
  129. package/lib/merge.js +1 -1
  130. package/lib/mergeHelpers.js +1 -1
  131. package/lib/mergeInto.js +1 -1
  132. package/lib/mixInto.js +1 -1
  133. package/lib/objMap.js +1 -1
  134. package/lib/objMapKeyVal.js +1 -1
  135. package/lib/onlyChild.js +1 -1
  136. package/lib/performanceNow.js +1 -1
  137. package/lib/shallowEqual.js +1 -1
  138. package/lib/shouldUpdateReactComponent.js +1 -1
  139. package/lib/traverseAllChildren.js +1 -1
  140. package/lib/warning.js +19 -11
  141. package/package.json +3 -2
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -318,6 +318,8 @@ var ReactEventEmitter = merge(ReactEventEmitterMixin, {
318
318
  }
319
319
  },
320
320
 
321
+ eventNameDispatchConfigs: EventPluginHub.eventNameDispatchConfigs,
322
+
321
323
  registrationNameModules: EventPluginHub.registrationNameModules,
322
324
 
323
325
  putListener: EventPluginHub.putListener,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -19,11 +19,13 @@
19
19
 
20
20
  "use strict";
21
21
 
22
+ var PooledClass = require("./PooledClass");
22
23
  var ReactEventEmitter = require("./ReactEventEmitter");
23
24
  var ReactInstanceHandles = require("./ReactInstanceHandles");
24
25
  var ReactMount = require("./ReactMount");
25
26
 
26
27
  var getEventTarget = require("./getEventTarget");
28
+ var mixInto = require("./mixInto");
27
29
 
28
30
  /**
29
31
  * @type {boolean}
@@ -49,6 +51,53 @@ function findParent(node) {
49
51
  return parent;
50
52
  }
51
53
 
54
+ /**
55
+ * Calls ReactEventEmitter.handleTopLevel for each node stored in bookKeeping's
56
+ * ancestor list. Separated from createTopLevelCallback to avoid try/finally
57
+ * deoptimization.
58
+ *
59
+ * @param {string} topLevelType
60
+ * @param {DOMEvent} nativeEvent
61
+ * @param {TopLevelCallbackBookKeeping} bookKeeping
62
+ */
63
+ function handleTopLevelImpl(topLevelType, nativeEvent, bookKeeping) {
64
+ var topLevelTarget = ReactMount.getFirstReactDOM(
65
+ getEventTarget(nativeEvent)
66
+ ) || window;
67
+
68
+ // Loop through the hierarchy, in case there's any nested components.
69
+ // It's important that we build the array of ancestors before calling any
70
+ // event handlers, because event handlers can modify the DOM, leading to
71
+ // inconsistencies with ReactMount's node cache. See #1105.
72
+ var ancestor = topLevelTarget;
73
+ while (ancestor) {
74
+ bookKeeping.ancestors.push(ancestor);
75
+ ancestor = findParent(ancestor);
76
+ }
77
+
78
+ for (var i = 0, l = bookKeeping.ancestors.length; i < l; i++) {
79
+ topLevelTarget = bookKeeping.ancestors[i];
80
+ var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
81
+ ReactEventEmitter.handleTopLevel(
82
+ topLevelType,
83
+ topLevelTarget,
84
+ topLevelTargetID,
85
+ nativeEvent
86
+ );
87
+ }
88
+ }
89
+
90
+ // Used to store ancestor hierarchy in top level callback
91
+ function TopLevelCallbackBookKeeping() {
92
+ this.ancestors = [];
93
+ }
94
+ mixInto(TopLevelCallbackBookKeeping, {
95
+ destructor: function() {
96
+ this.ancestors.length = 0;
97
+ }
98
+ });
99
+ PooledClass.addPoolingTo(TopLevelCallbackBookKeeping);
100
+
52
101
  /**
53
102
  * Top-level callback creator used to implement event handling using delegation.
54
103
  * This is used via dependency injection.
@@ -85,21 +134,12 @@ var ReactEventTopLevelCallback = {
85
134
  if (!_topLevelListenersEnabled) {
86
135
  return;
87
136
  }
88
- var topLevelTarget = ReactMount.getFirstReactDOM(
89
- getEventTarget(nativeEvent)
90
- ) || window;
91
-
92
- // Loop through the hierarchy, in case there's any nested components.
93
- while (topLevelTarget) {
94
- var topLevelTargetID = ReactMount.getID(topLevelTarget) || '';
95
- ReactEventEmitter.handleTopLevel(
96
- topLevelType,
97
- topLevelTarget,
98
- topLevelTargetID,
99
- nativeEvent
100
- );
101
-
102
- topLevelTarget = findParent(topLevelTarget);
137
+
138
+ var bookKeeping = TopLevelCallbackBookKeeping.getPooled();
139
+ try {
140
+ handleTopLevelImpl(topLevelType, nativeEvent, bookKeeping);
141
+ } finally {
142
+ TopLevelCallbackBookKeeping.release(bookKeeping);
103
143
  }
104
144
  };
105
145
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/ReactLink.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/ReactMount.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/ReactOwner.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
package/lib/ReactPerf.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2014 Facebook, Inc.
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -145,7 +145,7 @@ function createPrimitiveTypeChecker(expectedType) {
145
145
  var propType = getPropType(propValue);
146
146
  var isValid = propType === expectedType;
147
147
  if (shouldWarn) {
148
- warning(
148
+ ("production" !== process.env.NODE_ENV ? warning(
149
149
  isValid,
150
150
  'Invalid %s `%s` of type `%s` supplied to `%s`, expected `%s`.',
151
151
  ReactPropTypeLocationNames[location],
@@ -153,7 +153,7 @@ function createPrimitiveTypeChecker(expectedType) {
153
153
  propType,
154
154
  componentName,
155
155
  expectedType
156
- );
156
+ ) : null);
157
157
  }
158
158
  return isValid;
159
159
  }
@@ -167,14 +167,14 @@ function createEnumTypeChecker(expectedValues) {
167
167
  ) {
168
168
  var isValid = expectedEnum[propValue];
169
169
  if (shouldWarn) {
170
- warning(
170
+ ("production" !== process.env.NODE_ENV ? warning(
171
171
  isValid,
172
172
  'Invalid %s `%s` supplied to `%s`, expected one of %s.',
173
173
  ReactPropTypeLocationNames[location],
174
174
  propName,
175
175
  componentName,
176
176
  JSON.stringify(Object.keys(expectedEnum))
177
- );
177
+ ) : null);
178
178
  }
179
179
  return isValid;
180
180
  }
@@ -196,14 +196,14 @@ function createShapeTypeChecker(shapeTypes) {
196
196
  }
197
197
  }
198
198
  if (shouldWarn) {
199
- warning(
199
+ ("production" !== process.env.NODE_ENV ? warning(
200
200
  isValid,
201
201
  'Invalid %s `%s` of type `%s` supplied to `%s`, expected `object`.',
202
202
  ReactPropTypeLocationNames[location],
203
203
  propName,
204
204
  propType,
205
205
  componentName
206
- );
206
+ ) : null);
207
207
  }
208
208
  return isValid;
209
209
  }
@@ -216,14 +216,14 @@ function createInstanceTypeChecker(expectedClass) {
216
216
  ) {
217
217
  var isValid = propValue instanceof expectedClass;
218
218
  if (shouldWarn) {
219
- warning(
219
+ ("production" !== process.env.NODE_ENV ? warning(
220
220
  isValid,
221
221
  'Invalid %s `%s` supplied to `%s`, expected instance of `%s`.',
222
222
  ReactPropTypeLocationNames[location],
223
223
  propName,
224
224
  componentName,
225
225
  expectedClass.name || ANONYMOUS
226
- );
226
+ ) : null);
227
227
  }
228
228
  return isValid;
229
229
  }
@@ -243,13 +243,13 @@ function createArrayOfTypeChecker(propTypeChecker) {
243
243
  }
244
244
  }
245
245
  if (shouldWarn) {
246
- warning(
246
+ ("production" !== process.env.NODE_ENV ? warning(
247
247
  isValid,
248
248
  'Invalid %s `%s` supplied to `%s`, expected an array.',
249
249
  ReactPropTypeLocationNames[location],
250
250
  propName,
251
251
  componentName
252
- );
252
+ ) : null);
253
253
  }
254
254
  return isValid;
255
255
  }
@@ -262,13 +262,13 @@ function createRenderableTypeChecker() {
262
262
  ) {
263
263
  var isValid = isRenderable(propValue);
264
264
  if (shouldWarn) {
265
- warning(
265
+ ("production" !== process.env.NODE_ENV ? warning(
266
266
  isValid,
267
267
  'Invalid %s `%s` supplied to `%s`, expected a renderable prop.',
268
268
  ReactPropTypeLocationNames[location],
269
269
  propName,
270
270
  componentName
271
- );
271
+ ) : null);
272
272
  }
273
273
  return isValid;
274
274
  }
@@ -281,13 +281,13 @@ function createComponentTypeChecker() {
281
281
  ) {
282
282
  var isValid = ReactComponent.isValidComponent(propValue);
283
283
  if (shouldWarn) {
284
- warning(
284
+ ("production" !== process.env.NODE_ENV ? warning(
285
285
  isValid,
286
286
  'Invalid %s `%s` supplied to `%s`, expected a React component.',
287
287
  ReactPropTypeLocationNames[location],
288
288
  propName,
289
289
  componentName
290
- );
290
+ ) : null);
291
291
  }
292
292
  return isValid;
293
293
  }
@@ -307,13 +307,13 @@ function createUnionTypeChecker(arrayOfValidators) {
307
307
  break;
308
308
  }
309
309
  }
310
- warning(
310
+ ("production" !== process.env.NODE_ENV ? warning(
311
311
  isValid,
312
312
  'Invalid %s `%s` supplied to `%s`.',
313
313
  ReactPropTypeLocationNames[location],
314
314
  propName,
315
315
  componentName || ANONYMOUS
316
- );
316
+ ) : null);
317
317
  return isValid;
318
318
  };
319
319
  }
@@ -335,13 +335,13 @@ function createChainableTypeChecker(validate) {
335
335
  } else {
336
336
  var isValid = !isRequired;
337
337
  if (shouldWarn) {
338
- warning(
338
+ ("production" !== process.env.NODE_ENV ? warning(
339
339
  isValid,
340
340
  'Required %s `%s` was not specified in `%s`.',
341
341
  ReactPropTypeLocationNames[location],
342
342
  propName,
343
343
  componentName || ANONYMOUS
344
- );
344
+ ) : null);
345
345
  }
346
346
  return isValid;
347
347
  }