react 0.13.0-alpha.1 → 0.13.0-rc1

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 (182) hide show
  1. package/dist/JSXTransformer.js +1376 -596
  2. package/dist/react-with-addons.js +3256 -2363
  3. package/dist/react-with-addons.min.js +7 -7
  4. package/dist/react.js +3092 -2266
  5. package/dist/react.min.js +6 -7
  6. package/lib/AutoFocusMixin.js +2 -2
  7. package/lib/BeforeInputEventPlugin.js +5 -9
  8. package/lib/CSSCore.js +1 -1
  9. package/lib/CSSProperty.js +4 -2
  10. package/lib/CSSPropertyOperations.js +44 -17
  11. package/lib/CallbackQueue.js +3 -3
  12. package/lib/ChangeEventPlugin.js +2 -2
  13. package/lib/ClientReactRootIndex.js +2 -2
  14. package/lib/DOMChildrenOperations.js +10 -47
  15. package/lib/DOMProperty.js +2 -2
  16. package/lib/DOMPropertyOperations.js +11 -16
  17. package/lib/Danger.js +7 -6
  18. package/lib/DefaultEventPluginOrder.js +3 -3
  19. package/lib/EnterLeaveEventPlugin.js +2 -2
  20. package/lib/EventConstants.js +2 -2
  21. package/lib/EventListener.js +1 -1
  22. package/lib/EventPluginHub.js +10 -8
  23. package/lib/EventPluginRegistry.js +2 -2
  24. package/lib/EventPluginUtils.js +4 -4
  25. package/lib/EventPropagators.js +2 -2
  26. package/lib/ExecutionEnvironment.js +1 -1
  27. package/lib/FallbackCompositionState.js +7 -5
  28. package/lib/HTMLDOMPropertyConfig.js +22 -10
  29. package/lib/LinkedStateMixin.js +2 -2
  30. package/lib/LinkedValueUtils.js +4 -4
  31. package/lib/LocalEventTrapMixin.js +10 -3
  32. package/lib/MobileSafariClickEventPlugin.js +2 -2
  33. package/lib/Object.assign.js +2 -2
  34. package/lib/PooledClass.js +2 -2
  35. package/lib/React.js +9 -13
  36. package/lib/ReactBrowserComponentMixin.js +2 -2
  37. package/lib/ReactBrowserEventEmitter.js +4 -4
  38. package/lib/ReactCSSTransitionGroup.js +2 -2
  39. package/lib/ReactCSSTransitionGroupChild.js +12 -7
  40. package/lib/ReactChildReconciler.js +11 -7
  41. package/lib/ReactChildren.js +13 -10
  42. package/lib/ReactClass.js +161 -135
  43. package/lib/ReactComponent.js +100 -158
  44. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  45. package/lib/ReactComponentEnvironment.js +3 -3
  46. package/lib/ReactComponentWithPureRenderMixin.js +2 -2
  47. package/lib/ReactCompositeComponent.js +336 -484
  48. package/lib/ReactContext.js +14 -4
  49. package/lib/ReactCurrentOwner.js +2 -2
  50. package/lib/ReactDOM.js +2 -2
  51. package/lib/ReactDOMButton.js +2 -2
  52. package/lib/ReactDOMComponent.js +42 -52
  53. package/lib/ReactDOMForm.js +2 -2
  54. package/lib/ReactDOMIDOperations.js +4 -4
  55. package/lib/ReactDOMIframe.js +43 -0
  56. package/lib/ReactDOMImg.js +2 -2
  57. package/lib/ReactDOMInput.js +2 -2
  58. package/lib/ReactDOMOption.js +2 -2
  59. package/lib/ReactDOMSelect.js +3 -3
  60. package/lib/ReactDOMSelection.js +2 -2
  61. package/lib/ReactDOMTextComponent.js +4 -13
  62. package/lib/ReactDOMTextarea.js +2 -2
  63. package/lib/ReactDefaultBatchingStrategy.js +5 -5
  64. package/lib/ReactDefaultInjection.js +26 -2
  65. package/lib/ReactDefaultPerf.js +12 -4
  66. package/lib/ReactDefaultPerfAnalysis.js +1 -1
  67. package/lib/ReactElement.js +7 -5
  68. package/lib/ReactElementValidator.js +185 -65
  69. package/lib/ReactEmptyComponent.js +17 -6
  70. package/lib/ReactErrorUtils.js +1 -1
  71. package/lib/ReactEventEmitterMixin.js +2 -2
  72. package/lib/ReactEventListener.js +4 -5
  73. package/lib/ReactFragment.js +180 -0
  74. package/lib/ReactInjection.js +2 -2
  75. package/lib/ReactInputSelection.js +2 -2
  76. package/lib/ReactInstanceHandles.js +4 -3
  77. package/lib/ReactInstanceMap.js +2 -2
  78. package/lib/ReactLifeCycle.js +35 -0
  79. package/lib/ReactLink.js +2 -2
  80. package/lib/ReactMarkupChecksum.js +2 -2
  81. package/lib/ReactMount.js +87 -23
  82. package/lib/ReactMultiChild.js +19 -7
  83. package/lib/ReactMultiChildUpdateTypes.js +2 -2
  84. package/lib/ReactNativeComponent.js +34 -37
  85. package/lib/ReactOwner.js +2 -2
  86. package/lib/ReactPerf.js +2 -2
  87. package/lib/ReactPropTransferer.js +3 -3
  88. package/lib/ReactPropTypeLocationNames.js +2 -2
  89. package/lib/ReactPropTypeLocations.js +2 -2
  90. package/lib/ReactPropTypes.js +16 -8
  91. package/lib/ReactPutListenerQueue.js +2 -2
  92. package/lib/ReactReconcileTransaction.js +2 -2
  93. package/lib/ReactReconciler.js +121 -0
  94. package/lib/ReactRef.js +41 -68
  95. package/lib/ReactRootIndex.js +2 -2
  96. package/lib/ReactServerRendering.js +4 -3
  97. package/lib/ReactServerRenderingTransaction.js +2 -2
  98. package/lib/ReactStateSetters.js +2 -2
  99. package/lib/ReactTestUtils.js +49 -8
  100. package/lib/ReactTransitionChildMapping.js +8 -4
  101. package/lib/ReactTransitionEvents.js +2 -2
  102. package/lib/ReactTransitionGroup.js +6 -6
  103. package/lib/ReactUpdateQueue.js +295 -0
  104. package/lib/ReactUpdates.js +13 -22
  105. package/lib/ReactWithAddons.js +4 -2
  106. package/lib/SVGDOMPropertyConfig.js +2 -2
  107. package/lib/SelectEventPlugin.js +4 -4
  108. package/lib/ServerReactRootIndex.js +2 -2
  109. package/lib/SimpleEventPlugin.js +4 -4
  110. package/lib/SyntheticClipboardEvent.js +2 -3
  111. package/lib/SyntheticCompositionEvent.js +2 -3
  112. package/lib/SyntheticDragEvent.js +2 -2
  113. package/lib/SyntheticEvent.js +12 -4
  114. package/lib/SyntheticFocusEvent.js +2 -2
  115. package/lib/SyntheticInputEvent.js +2 -3
  116. package/lib/SyntheticKeyboardEvent.js +2 -2
  117. package/lib/SyntheticMouseEvent.js +2 -2
  118. package/lib/SyntheticTouchEvent.js +2 -2
  119. package/lib/SyntheticUIEvent.js +2 -2
  120. package/lib/SyntheticWheelEvent.js +2 -2
  121. package/lib/Transaction.js +5 -5
  122. package/lib/ViewportMetrics.js +2 -2
  123. package/lib/accumulateInto.js +2 -2
  124. package/lib/adler32.js +2 -2
  125. package/lib/camelize.js +1 -1
  126. package/lib/camelizeStyleName.js +1 -1
  127. package/lib/cloneWithProps.js +4 -4
  128. package/lib/containsNode.js +1 -1
  129. package/lib/{createArrayFrom.js → createArrayFromMixed.js} +6 -6
  130. package/lib/createFullPageComponent.js +2 -2
  131. package/lib/createNodesFromMarkup.js +4 -4
  132. package/lib/cx.js +16 -1
  133. package/lib/dangerousStyleValue.js +2 -2
  134. package/lib/emptyFunction.js +1 -1
  135. package/lib/emptyObject.js +1 -1
  136. package/lib/{escapeTextForBrowser.js → escapeTextContentForBrowser.js} +10 -11
  137. package/lib/findDOMNode.js +26 -9
  138. package/lib/flattenChildren.js +11 -9
  139. package/lib/focusNode.js +1 -1
  140. package/lib/forEachAccumulated.js +2 -2
  141. package/lib/getActiveElement.js +1 -1
  142. package/lib/getEventCharCode.js +2 -2
  143. package/lib/getEventKey.js +2 -2
  144. package/lib/getEventModifierState.js +2 -2
  145. package/lib/getEventTarget.js +2 -2
  146. package/lib/getIteratorFn.js +2 -2
  147. package/lib/getMarkupWrap.js +1 -1
  148. package/lib/getNodeForCharacterOffset.js +3 -3
  149. package/lib/getReactRootElementInContainer.js +2 -2
  150. package/lib/getTextContentAccessor.js +2 -2
  151. package/lib/getUnboundedScrollPosition.js +1 -1
  152. package/lib/hyphenate.js +1 -1
  153. package/lib/hyphenateStyleName.js +1 -1
  154. package/lib/instantiateReactComponent.js +21 -21
  155. package/lib/invariant.js +1 -1
  156. package/lib/isEventSupported.js +2 -2
  157. package/lib/isNode.js +1 -1
  158. package/lib/isTextInputElement.js +2 -2
  159. package/lib/isTextNode.js +1 -1
  160. package/lib/joinClasses.js +2 -2
  161. package/lib/keyMirror.js +2 -2
  162. package/lib/keyOf.js +1 -1
  163. package/lib/mapObject.js +1 -1
  164. package/lib/memoizeStringOnly.js +5 -6
  165. package/lib/onlyChild.js +2 -2
  166. package/lib/performance.js +1 -1
  167. package/lib/performanceNow.js +1 -1
  168. package/lib/quoteAttributeValueForBrowser.js +26 -0
  169. package/lib/setInnerHTML.js +13 -2
  170. package/lib/setTextContent.js +40 -0
  171. package/lib/shallowEqual.js +2 -2
  172. package/lib/shouldUpdateReactComponent.js +64 -8
  173. package/lib/toArray.js +2 -2
  174. package/lib/traverseAllChildren.js +19 -5
  175. package/lib/update.js +2 -2
  176. package/lib/warning.js +20 -2
  177. package/package.json +1 -1
  178. package/lib/accumulate.js +0 -47
  179. package/lib/copyProperties.js +0 -56
  180. package/lib/merge.js +0 -34
  181. package/lib/mergeInto.js +0 -24
  182. package/lib/monitorCodeUse.js +0 -30
package/lib/Danger.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -12,7 +12,7 @@
12
12
 
13
13
  /*jslint evil: true, sub: true */
14
14
 
15
- "use strict";
15
+ 'use strict';
16
16
 
17
17
  var ExecutionEnvironment = require("./ExecutionEnvironment");
18
18
 
@@ -82,7 +82,8 @@ var Danger = {
82
82
  // This for-in loop skips the holes of the sparse array. The order of
83
83
  // iteration should follow the order of assignment, which happens to match
84
84
  // numerical index order, but we don't rely on that.
85
- for (var resultIndex in markupListByNodeName) {
85
+ var resultIndex;
86
+ for (resultIndex in markupListByNodeName) {
86
87
  if (markupListByNodeName.hasOwnProperty(resultIndex)) {
87
88
  var markup = markupListByNodeName[resultIndex];
88
89
 
@@ -103,8 +104,8 @@ var Danger = {
103
104
  emptyFunction // Do nothing special with <script> tags.
104
105
  );
105
106
 
106
- for (i = 0; i < renderNodes.length; ++i) {
107
- var renderNode = renderNodes[i];
107
+ for (var j = 0; j < renderNodes.length; ++j) {
108
+ var renderNode = renderNodes[j];
108
109
  if (renderNode.hasAttribute &&
109
110
  renderNode.hasAttribute(RESULT_INDEX_ATTR)) {
110
111
 
@@ -124,7 +125,7 @@ var Danger = {
124
125
 
125
126
  } else if ("production" !== process.env.NODE_ENV) {
126
127
  console.error(
127
- "Danger: Discarding unexpected node:",
128
+ 'Danger: Discarding unexpected node:',
128
129
  renderNode
129
130
  );
130
131
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,9 +9,9 @@
9
9
  * @providesModule DefaultEventPluginOrder
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
- var keyOf = require("./keyOf");
14
+ var keyOf = require("./keyOf");
15
15
 
16
16
  /**
17
17
  * Module that is injectable into `EventPluginHub`, that specifies a
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var EventConstants = require("./EventConstants");
16
16
  var EventPropagators = require("./EventPropagators");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,7 +9,7 @@
9
9
  * @providesModule EventConstants
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var keyMirror = require("./keyMirror");
15
15
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014 Facebook, Inc.
2
+ * Copyright 2013-2015, 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-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,7 +9,7 @@
9
9
  * @providesModule EventPluginHub
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventPluginRegistry = require("./EventPluginRegistry");
15
15
  var EventPluginUtils = require("./EventPluginUtils");
@@ -58,12 +58,14 @@ var executeDispatchesAndRelease = function(event) {
58
58
  var InstanceHandle = null;
59
59
 
60
60
  function validateInstanceHandle() {
61
- var invalid = !InstanceHandle||
62
- !InstanceHandle.traverseTwoPhase ||
63
- !InstanceHandle.traverseEnterLeave;
64
- if (invalid) {
65
- throw new Error('InstanceHandle not injected before use!');
66
- }
61
+ var valid =
62
+ InstanceHandle &&
63
+ InstanceHandle.traverseTwoPhase &&
64
+ InstanceHandle.traverseEnterLeave;
65
+ ("production" !== process.env.NODE_ENV ? invariant(
66
+ valid,
67
+ 'InstanceHandle not injected before use!'
68
+ ) : invariant(valid));
67
69
  }
68
70
 
69
71
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var invariant = require("./invariant");
16
16
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,7 +9,7 @@
9
9
  * @providesModule EventPluginUtils
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventConstants = require("./EventConstants");
15
15
 
@@ -115,8 +115,8 @@ function executeDispatch(event, listener, domID) {
115
115
  /**
116
116
  * Standard/simple iteration through an event's collected dispatches.
117
117
  */
118
- function executeDispatchesInOrder(event, executeDispatch) {
119
- forEachEventDispatch(event, executeDispatch);
118
+ function executeDispatchesInOrder(event, cb) {
119
+ forEachEventDispatch(event, cb);
120
120
  event._dispatchListeners = null;
121
121
  event._dispatchIDs = null;
122
122
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,7 +9,7 @@
9
9
  * @providesModule EventPropagators
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var EventConstants = require("./EventConstants");
15
15
  var EventPluginHub = require("./EventPluginHub");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013 Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var PooledClass = require("./PooledClass");
16
16
 
@@ -58,19 +58,21 @@ assign(FallbackCompositionState.prototype, {
58
58
  return this._fallbackText;
59
59
  }
60
60
 
61
- var endValue = this.getText();
61
+ var start;
62
62
  var startValue = this._startText;
63
63
  var startLength = startValue.length;
64
+ var end;
65
+ var endValue = this.getText();
64
66
  var endLength = endValue.length;
65
67
 
66
- for (var start = 0; start < startLength; start++) {
68
+ for (start = 0; start < startLength; start++) {
67
69
  if (startValue[start] !== endValue[start]) {
68
70
  break;
69
71
  }
70
72
  }
71
73
 
72
74
  var minEnd = startLength - start;
73
- for (var end = 1; end <= minEnd; end++) {
75
+ for (end = 1; end <= minEnd; end++) {
74
76
  if (startValue[startLength - end] !== endValue[endLength - end]) {
75
77
  break;
76
78
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -11,7 +11,7 @@
11
11
 
12
12
  /*jslint bitwise: true*/
13
13
 
14
- "use strict";
14
+ 'use strict';
15
15
 
16
16
  var DOMProperty = require("./DOMProperty");
17
17
  var ExecutionEnvironment = require("./ExecutionEnvironment");
@@ -120,7 +120,7 @@ var HTMLDOMPropertyConfig = {
120
120
  muted: MUST_USE_PROPERTY | HAS_BOOLEAN_VALUE,
121
121
  name: null,
122
122
  noValidate: HAS_BOOLEAN_VALUE,
123
- open: null,
123
+ open: HAS_BOOLEAN_VALUE,
124
124
  pattern: null,
125
125
  placeholder: null,
126
126
  poster: null,
@@ -160,12 +160,22 @@ var HTMLDOMPropertyConfig = {
160
160
  /**
161
161
  * Non-standard Properties
162
162
  */
163
- autoCapitalize: null, // Supported in Mobile Safari for keyboard hints
164
- autoCorrect: null, // Supported in Mobile Safari for keyboard hints
165
- itemProp: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
166
- itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE, // Microdata: http://schema.org/docs/gs.html
167
- itemType: MUST_USE_ATTRIBUTE, // Microdata: http://schema.org/docs/gs.html
168
- property: null // Supports OG in meta tags
163
+ // autoCapitalize and autoCorrect are supported in Mobile Safari for
164
+ // keyboard hints.
165
+ autoCapitalize: null,
166
+ autoCorrect: null,
167
+ // itemProp, itemScope, itemType are for
168
+ // Microdata support. See http://schema.org/docs/gs.html
169
+ itemProp: MUST_USE_ATTRIBUTE,
170
+ itemScope: MUST_USE_ATTRIBUTE | HAS_BOOLEAN_VALUE,
171
+ itemType: MUST_USE_ATTRIBUTE,
172
+ // itemID and itemRef are for Microdata support as well but
173
+ // only specified in the the WHATWG spec document. See
174
+ // https://html.spec.whatwg.org/multipage/microdata.html#microdata-dom-api
175
+ itemID: MUST_USE_ATTRIBUTE,
176
+ itemRef: MUST_USE_ATTRIBUTE,
177
+ // property is supported for OpenGraph in meta tags.
178
+ property: null
169
179
  },
170
180
  DOMAttributeNames: {
171
181
  acceptCharset: 'accept-charset',
@@ -179,7 +189,9 @@ var HTMLDOMPropertyConfig = {
179
189
  autoCorrect: 'autocorrect',
180
190
  autoFocus: 'autofocus',
181
191
  autoPlay: 'autoplay',
182
- encType: 'enctype',
192
+ // `encoding` is equivalent to `enctype`, IE8 lacks an `enctype` setter.
193
+ // http://www.w3.org/TR/html5/forms.html#dom-fs-encoding
194
+ encType: 'encoding',
183
195
  hrefLang: 'hreflang',
184
196
  radioGroup: 'radiogroup',
185
197
  spellCheck: 'spellcheck',
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var ReactLink = require("./ReactLink");
16
16
  var ReactStateSetters = require("./ReactStateSetters");
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var ReactPropTypes = require("./ReactPropTypes");
16
16
 
@@ -81,7 +81,7 @@ var LinkedValueUtils = {
81
81
  props.onChange ||
82
82
  props.readOnly ||
83
83
  props.disabled) {
84
- return;
84
+ return null;
85
85
  }
86
86
  return new Error(
87
87
  'You provided a `value` prop to a form field without an ' +
@@ -95,7 +95,7 @@ var LinkedValueUtils = {
95
95
  props.onChange ||
96
96
  props.readOnly ||
97
97
  props.disabled) {
98
- return;
98
+ return null;
99
99
  }
100
100
  return new Error(
101
101
  'You provided a `checked` prop to a form field without an ' +
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014, Facebook, Inc.
2
+ * Copyright 2014-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,7 +9,7 @@
9
9
  * @providesModule LocalEventTrapMixin
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
15
15
 
@@ -24,10 +24,17 @@ function remove(event) {
24
24
  var LocalEventTrapMixin = {
25
25
  trapBubbledEvent:function(topLevelType, handlerBaseName) {
26
26
  ("production" !== process.env.NODE_ENV ? invariant(this.isMounted(), 'Must be mounted to trap events') : invariant(this.isMounted()));
27
+ // If a component renders to null or if another component fatals and causes
28
+ // the state of the tree to be corrupted, `node` here can be null.
29
+ var node = this.getDOMNode();
30
+ ("production" !== process.env.NODE_ENV ? invariant(
31
+ node,
32
+ 'LocalEventTrapMixin.trapBubbledEvent(...): Requires node to be rendered.'
33
+ ) : invariant(node));
27
34
  var listener = ReactBrowserEventEmitter.trapBubbledEvent(
28
35
  topLevelType,
29
36
  handlerBaseName,
30
- this.getDOMNode()
37
+ node
31
38
  );
32
39
  this._localEventListeners =
33
40
  accumulateInto(this._localEventListeners, listener);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -10,7 +10,7 @@
10
10
  * @typechecks static-only
11
11
  */
12
12
 
13
- "use strict";
13
+ 'use strict';
14
14
 
15
15
  var EventConstants = require("./EventConstants");
16
16
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2014, Facebook, Inc.
2
+ * Copyright 2014-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -11,7 +11,7 @@
11
11
 
12
12
  // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign
13
13
 
14
- "use strict";
14
+ 'use strict';
15
15
 
16
16
  function assign(target, sources) {
17
17
  if (target == null) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright 2013-2014, Facebook, Inc.
2
+ * Copyright 2013-2015, Facebook, Inc.
3
3
  * All rights reserved.
4
4
  *
5
5
  * This source code is licensed under the BSD-style license found in the
@@ -9,7 +9,7 @@
9
9
  * @providesModule PooledClass
10
10
  */
11
11
 
12
- "use strict";
12
+ 'use strict';
13
13
 
14
14
  var invariant = require("./invariant");
15
15