react 0.14.0-alpha2 → 0.14.0-beta3

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 (196) hide show
  1. package/README.md +5 -2
  2. package/addons.js +6 -3
  3. package/dist/JSXTransformer.js +634 -274
  4. package/dist/react-with-addons.js +5350 -4954
  5. package/dist/react-with-addons.min.js +6 -6
  6. package/dist/react.js +4777 -4408
  7. package/dist/react.min.js +6 -5
  8. package/lib/{AutoFocusMixin.js → AutoFocusUtils.js} +15 -5
  9. package/lib/BeforeInputEventPlugin.js +13 -13
  10. package/lib/CSSProperty.js +3 -0
  11. package/lib/CSSPropertyOperations.js +13 -13
  12. package/lib/CallbackQueue.js +4 -4
  13. package/lib/ChangeEventPlugin.js +16 -14
  14. package/lib/DOMChildrenOperations.js +10 -6
  15. package/lib/DOMProperty.js +82 -117
  16. package/lib/DOMPropertyOperations.js +78 -33
  17. package/lib/Danger.js +14 -14
  18. package/lib/DefaultEventPluginOrder.js +2 -2
  19. package/lib/EnterLeaveEventPlugin.js +8 -8
  20. package/lib/EventConstants.js +23 -1
  21. package/lib/EventPluginHub.js +13 -13
  22. package/lib/EventPluginRegistry.js +8 -8
  23. package/lib/EventPluginUtils.js +17 -17
  24. package/lib/EventPropagators.js +7 -7
  25. package/lib/FallbackCompositionState.js +3 -3
  26. package/lib/HTMLDOMPropertyConfig.js +13 -3
  27. package/lib/LinkedStateMixin.js +2 -2
  28. package/lib/LinkedValueUtils.js +50 -38
  29. package/lib/MetaMatchers.js +118 -0
  30. package/lib/OrderedMap.js +453 -0
  31. package/lib/PooledClass.js +14 -2
  32. package/lib/React.js +6 -6
  33. package/lib/ReactBrowserComponentMixin.js +4 -4
  34. package/lib/ReactBrowserEventEmitter.js +30 -7
  35. package/lib/ReactCSSTransitionGroup.js +16 -5
  36. package/lib/ReactCSSTransitionGroupChild.js +20 -11
  37. package/lib/ReactChildReconciler.js +25 -18
  38. package/lib/ReactChildren.js +9 -9
  39. package/lib/ReactClass.js +65 -83
  40. package/lib/ReactComponent.js +22 -17
  41. package/lib/ReactComponentBrowserEnvironment.js +2 -2
  42. package/lib/ReactComponentEnvironment.js +2 -2
  43. package/lib/ReactComponentWithPureRenderMixin.js +3 -3
  44. package/lib/ReactCompositeComponent.js +80 -111
  45. package/lib/ReactDOM.js +72 -158
  46. package/lib/ReactDOMButton.js +15 -26
  47. package/lib/ReactDOMComponent.js +378 -56
  48. package/lib/ReactDOMFactories.js +177 -0
  49. package/lib/ReactDOMIDOperations.js +23 -23
  50. package/lib/ReactDOMInput.js +83 -99
  51. package/lib/ReactDOMOption.js +25 -45
  52. package/lib/ReactDOMSelect.js +88 -98
  53. package/lib/ReactDOMSelection.js +3 -3
  54. package/lib/ReactDOMServer.js +2 -2
  55. package/lib/ReactDOMTextComponent.js +11 -11
  56. package/lib/ReactDOMTextarea.js +48 -61
  57. package/lib/ReactDefaultBatchingStrategy.js +4 -4
  58. package/lib/ReactDefaultInjection.js +24 -71
  59. package/lib/ReactDefaultPerf.js +7 -7
  60. package/lib/ReactDefaultPerfAnalysis.js +6 -9
  61. package/lib/ReactElement.js +22 -83
  62. package/lib/ReactElementValidator.js +48 -117
  63. package/lib/ReactEmptyComponent.js +4 -4
  64. package/lib/ReactErrorUtils.js +1 -1
  65. package/lib/ReactEventEmitterMixin.js +3 -4
  66. package/lib/ReactEventListener.js +57 -12
  67. package/lib/ReactFragment.js +22 -17
  68. package/lib/ReactInjection.js +11 -11
  69. package/lib/ReactInputSelection.js +8 -7
  70. package/lib/ReactInstanceHandles.js +12 -12
  71. package/lib/ReactIsomorphic.js +11 -11
  72. package/lib/ReactLink.js +1 -1
  73. package/lib/ReactMarkupChecksum.js +6 -2
  74. package/lib/ReactMount.js +88 -88
  75. package/lib/ReactMultiChild.js +83 -22
  76. package/lib/ReactMultiChildUpdateTypes.js +2 -1
  77. package/lib/ReactNativeComponent.js +3 -8
  78. package/lib/ReactNoopUpdateQueue.js +118 -0
  79. package/lib/ReactOwner.js +3 -3
  80. package/lib/ReactPerf.js +2 -2
  81. package/lib/ReactPropTransferer.js +3 -3
  82. package/lib/ReactPropTypeLocationNames.js +1 -1
  83. package/lib/ReactPropTypeLocations.js +1 -1
  84. package/lib/ReactPropTypes.js +49 -11
  85. package/lib/ReactReconcileTransaction.js +8 -8
  86. package/lib/ReactReconciler.js +18 -20
  87. package/lib/ReactRef.js +1 -1
  88. package/lib/ReactServerBatchingStrategy.js +23 -0
  89. package/lib/ReactServerRendering.js +22 -9
  90. package/lib/ReactServerRenderingTransaction.js +7 -7
  91. package/lib/ReactTestUtils.js +80 -58
  92. package/lib/ReactTransitionChildMapping.js +2 -2
  93. package/lib/ReactTransitionEvents.js +1 -1
  94. package/lib/ReactTransitionGroup.js +5 -6
  95. package/lib/ReactUpdateQueue.js +61 -36
  96. package/lib/ReactUpdates.js +14 -17
  97. package/lib/ReactWithAddons.js +14 -16
  98. package/lib/ResponderEventPlugin.js +514 -0
  99. package/lib/ResponderSyntheticEvent.js +40 -0
  100. package/lib/ResponderTouchHistoryStore.js +180 -0
  101. package/lib/SVGDOMPropertyConfig.js +1 -1
  102. package/lib/SelectEventPlugin.js +14 -15
  103. package/lib/SimpleEventPlugin.js +205 -29
  104. package/lib/SyntheticClipboardEvent.js +3 -3
  105. package/lib/SyntheticCompositionEvent.js +3 -3
  106. package/lib/SyntheticDragEvent.js +3 -3
  107. package/lib/SyntheticEvent.js +9 -8
  108. package/lib/SyntheticFocusEvent.js +3 -3
  109. package/lib/SyntheticInputEvent.js +3 -3
  110. package/lib/SyntheticKeyboardEvent.js +6 -6
  111. package/lib/SyntheticMouseEvent.js +5 -5
  112. package/lib/SyntheticTouchEvent.js +4 -4
  113. package/lib/SyntheticUIEvent.js +4 -4
  114. package/lib/SyntheticWheelEvent.js +3 -3
  115. package/lib/TapEventPlugin.js +119 -0
  116. package/lib/Transaction.js +16 -10
  117. package/lib/accumulate.js +44 -0
  118. package/lib/accumulateInto.js +2 -2
  119. package/lib/adler32.js +19 -7
  120. package/lib/cloneWithProps.js +12 -7
  121. package/lib/createHierarchyRenderer.js +85 -0
  122. package/lib/dangerousStyleValue.js +1 -1
  123. package/lib/deprecated.js +47 -0
  124. package/lib/findDOMNode.js +11 -12
  125. package/lib/flattenChildren.js +4 -4
  126. package/lib/forEachAccumulated.js +1 -1
  127. package/lib/getEventCharCode.js +1 -1
  128. package/lib/getEventKey.js +1 -1
  129. package/lib/getEventModifierState.js +0 -1
  130. package/lib/getTestDocument.js +28 -0
  131. package/lib/getTextContentAccessor.js +1 -1
  132. package/lib/instantiateReactComponent.js +24 -20
  133. package/lib/isEventSupported.js +1 -1
  134. package/lib/isTextInputElement.js +2 -1
  135. package/lib/joinClasses.js +1 -1
  136. package/lib/onlyChild.js +3 -3
  137. package/lib/quoteAttributeValueForBrowser.js +1 -1
  138. package/lib/reactComponentExpect.js +210 -0
  139. package/lib/renderSubtreeIntoContainer.js +1 -1
  140. package/lib/setInnerHTML.js +2 -2
  141. package/lib/setTextContent.js +3 -3
  142. package/lib/shallowCompare.js +1 -1
  143. package/lib/sliceChildren.js +51 -0
  144. package/lib/traverseAllChildren.js +15 -14
  145. package/lib/update.js +13 -13
  146. package/lib/validateDOMNesting.js +14 -6
  147. package/lib/webcomponents.js +6379 -0
  148. package/package.json +4 -6
  149. package/react.js +53 -1
  150. package/addons/CSSTransitionGroup.js +0 -1
  151. package/addons/LinkedStateMixin.js +0 -1
  152. package/addons/Perf.js +0 -1
  153. package/addons/PureRenderMixin.js +0 -1
  154. package/addons/TestUtils.js +0 -1
  155. package/addons/TransitionGroup.js +0 -1
  156. package/addons/batchedUpdates.js +0 -1
  157. package/addons/cloneWithProps.js +0 -1
  158. package/addons/createFragment.js +0 -1
  159. package/addons/renderSubtreeIntoContainer.js +0 -1
  160. package/addons/shallowCompare.js +0 -1
  161. package/addons/update.js +0 -1
  162. package/lib/CSSCore.js +0 -97
  163. package/lib/EventListener.js +0 -84
  164. package/lib/ExecutionEnvironment.js +0 -38
  165. package/lib/LocalEventTrapMixin.js +0 -46
  166. package/lib/ReactContext.js +0 -32
  167. package/lib/ReactDOMClient.js +0 -85
  168. package/lib/ReactDOMForm.js +0 -47
  169. package/lib/ReactDOMIframe.js +0 -43
  170. package/lib/ReactDOMImg.js +0 -44
  171. package/lib/ReactLifeCycle.js +0 -35
  172. package/lib/camelize.js +0 -32
  173. package/lib/camelizeStyleName.js +0 -40
  174. package/lib/containsNode.js +0 -55
  175. package/lib/createArrayFromMixed.js +0 -85
  176. package/lib/createFullPageComponent.js +0 -51
  177. package/lib/createNodesFromMarkup.js +0 -84
  178. package/lib/emptyFunction.js +0 -38
  179. package/lib/emptyObject.js +0 -20
  180. package/lib/focusNode.js +0 -26
  181. package/lib/getActiveElement.js +0 -29
  182. package/lib/getMarkupWrap.js +0 -115
  183. package/lib/getUnboundedScrollPosition.js +0 -38
  184. package/lib/hyphenate.js +0 -33
  185. package/lib/hyphenateStyleName.js +0 -39
  186. package/lib/invariant.js +0 -49
  187. package/lib/isNode.js +0 -23
  188. package/lib/isTextNode.js +0 -25
  189. package/lib/keyMirror.js +0 -48
  190. package/lib/keyOf.js +0 -35
  191. package/lib/mapObject.js +0 -51
  192. package/lib/performance.js +0 -23
  193. package/lib/performanceNow.js +0 -28
  194. package/lib/shallowEqual.js +0 -48
  195. package/lib/toArray.js +0 -57
  196. package/lib/warning.js +0 -61
package/lib/ReactLink.js CHANGED
@@ -35,7 +35,7 @@
35
35
  * consumption of ReactLink easier; see LinkedValueUtils and LinkedStateMixin.
36
36
  */
37
37
 
38
- var React = require("./React");
38
+ var React = require('./React');
39
39
 
40
40
  /**
41
41
  * @param {*} value current value of the link
@@ -11,7 +11,9 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var adler32 = require("./adler32");
14
+ var adler32 = require('./adler32');
15
+
16
+ var TAG_END = /\/?>/;
15
17
 
16
18
  var ReactMarkupChecksum = {
17
19
  CHECKSUM_ATTR_NAME: 'data-react-checksum',
@@ -22,7 +24,9 @@ var ReactMarkupChecksum = {
22
24
  */
23
25
  addChecksumToMarkup: function (markup) {
24
26
  var checksum = adler32(markup);
25
- return markup.replace('>', ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '">');
27
+
28
+ // Add checksum (handle both parent tags and self-closing tags)
29
+ return markup.replace(TAG_END, ' ' + ReactMarkupChecksum.CHECKSUM_ATTR_NAME + '="' + checksum + '"$&');
26
30
  },
27
31
 
28
32
  /**
package/lib/ReactMount.js CHANGED
@@ -11,28 +11,27 @@
11
11
 
12
12
  'use strict';
13
13
 
14
- var DOMProperty = require("./DOMProperty");
15
- var ReactBrowserEventEmitter = require("./ReactBrowserEventEmitter");
16
- var ReactCurrentOwner = require("./ReactCurrentOwner");
17
- var ReactElement = require("./ReactElement");
18
- var ReactElementValidator = require("./ReactElementValidator");
19
- var ReactEmptyComponent = require("./ReactEmptyComponent");
20
- var ReactInstanceHandles = require("./ReactInstanceHandles");
21
- var ReactInstanceMap = require("./ReactInstanceMap");
22
- var ReactMarkupChecksum = require("./ReactMarkupChecksum");
23
- var ReactPerf = require("./ReactPerf");
24
- var ReactReconciler = require("./ReactReconciler");
25
- var ReactUpdateQueue = require("./ReactUpdateQueue");
26
- var ReactUpdates = require("./ReactUpdates");
27
-
28
- var emptyObject = require("./emptyObject");
29
- var containsNode = require("./containsNode");
30
- var instantiateReactComponent = require("./instantiateReactComponent");
31
- var invariant = require("./invariant");
32
- var setInnerHTML = require("./setInnerHTML");
33
- var shouldUpdateReactComponent = require("./shouldUpdateReactComponent");
34
- var validateDOMNesting = require("./validateDOMNesting");
35
- var warning = require("./warning");
14
+ var DOMProperty = require('./DOMProperty');
15
+ var ReactBrowserEventEmitter = require('./ReactBrowserEventEmitter');
16
+ var ReactCurrentOwner = require('./ReactCurrentOwner');
17
+ var ReactElement = require('./ReactElement');
18
+ var ReactEmptyComponent = require('./ReactEmptyComponent');
19
+ var ReactInstanceHandles = require('./ReactInstanceHandles');
20
+ var ReactInstanceMap = require('./ReactInstanceMap');
21
+ var ReactMarkupChecksum = require('./ReactMarkupChecksum');
22
+ var ReactPerf = require('./ReactPerf');
23
+ var ReactReconciler = require('./ReactReconciler');
24
+ var ReactUpdateQueue = require('./ReactUpdateQueue');
25
+ var ReactUpdates = require('./ReactUpdates');
26
+
27
+ var emptyObject = require('fbjs/lib/emptyObject');
28
+ var containsNode = require('fbjs/lib/containsNode');
29
+ var instantiateReactComponent = require('./instantiateReactComponent');
30
+ var invariant = require('fbjs/lib/invariant');
31
+ var setInnerHTML = require('./setInnerHTML');
32
+ var shouldUpdateReactComponent = require('./shouldUpdateReactComponent');
33
+ var validateDOMNesting = require('./validateDOMNesting');
34
+ var warning = require('fbjs/lib/warning');
36
35
 
37
36
  var SEPARATOR = ReactInstanceHandles.SEPARATOR;
38
37
 
@@ -49,7 +48,7 @@ var instancesByReactRootID = {};
49
48
  /** Mapping from reactRootID to `container` nodes. */
50
49
  var containersByReactRootID = {};
51
50
 
52
- if ('production' !== process.env.NODE_ENV) {
51
+ if (process.env.NODE_ENV !== 'production') {
53
52
  /** __DEV__-only mapping from reactRootID to root elements. */
54
53
  var rootElementsByReactRootID = {};
55
54
  }
@@ -115,7 +114,7 @@ function getID(node) {
115
114
  if (nodeCache.hasOwnProperty(id)) {
116
115
  var cached = nodeCache[id];
117
116
  if (cached !== node) {
118
- 'production' !== process.env.NODE_ENV ? invariant(!isValid(cached, id), 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(!isValid(cached, id));
117
+ !!isValid(cached, id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Two valid but unequal nodes with the same `%s`: %s', ATTR_NAME, id) : invariant(false) : undefined;
119
118
 
120
119
  nodeCache[id] = node;
121
120
  }
@@ -193,7 +192,7 @@ function getNodeFromInstance(instance) {
193
192
  */
194
193
  function isValid(node, id) {
195
194
  if (node) {
196
- 'production' !== process.env.NODE_ENV ? invariant(internalGetID(node) === id, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(internalGetID(node) === id);
195
+ !(internalGetID(node) === id) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ReactMount: Unexpected modification of `%s`', ATTR_NAME) : invariant(false) : undefined;
197
196
 
198
197
  var container = ReactMount.findReactContainerForID(id);
199
198
  if (container && containsNode(container, node)) {
@@ -247,7 +246,7 @@ function findDeepestCachedAncestor(targetID) {
247
246
  * @param {boolean} shouldReuseMarkup If true, do not insert markup
248
247
  */
249
248
  function mountComponentIntoNode(componentInstance, rootID, container, transaction, shouldReuseMarkup, context) {
250
- if ('production' !== process.env.NODE_ENV) {
249
+ if (process.env.NODE_ENV !== 'production') {
251
250
  if (context === emptyObject) {
252
251
  context = {};
253
252
  }
@@ -255,7 +254,7 @@ function mountComponentIntoNode(componentInstance, rootID, container, transactio
255
254
  context[validateDOMNesting.ancestorInfoContextKey] = validateDOMNesting.updatedAncestorInfo(null, tag, null);
256
255
  }
257
256
  var markup = ReactReconciler.mountComponent(componentInstance, rootID, transaction, context);
258
- componentInstance._isTopLevel = true;
257
+ componentInstance._renderedComponent._topLevelWrapper = componentInstance;
259
258
  ReactMount._mountImageIntoNode(markup, container, shouldReuseMarkup);
260
259
  }
261
260
 
@@ -295,6 +294,17 @@ function unmountComponentFromNode(instance, container) {
295
294
  }
296
295
  }
297
296
 
297
+ /**
298
+ * Temporary (?) hack so that we can store all top-level pending updates on
299
+ * composites instead of having to worry about different types of components
300
+ * here.
301
+ */
302
+ var TopLevelWrapper = function () {};
303
+ TopLevelWrapper.prototype.render = function () {
304
+ // this.props is actually a ReactElement
305
+ return this.props;
306
+ };
307
+
298
308
  /**
299
309
  * Mounting is the process of initializing a React component by creating its
300
310
  * representative DOM elements and inserting them into a supplied `container`.
@@ -337,10 +347,6 @@ var ReactMount = {
337
347
  * @param {?function} callback function triggered on completion
338
348
  */
339
349
  _updateRootComponent: function (prevComponent, nextElement, container, callback) {
340
- if ('production' !== process.env.NODE_ENV) {
341
- ReactElementValidator.checkAndWarnForMutatedProps(nextElement);
342
- }
343
-
344
350
  ReactMount.scrollMonitor(container, function () {
345
351
  ReactUpdateQueue.enqueueElementInternal(prevComponent, nextElement);
346
352
  if (callback) {
@@ -348,7 +354,7 @@ var ReactMount = {
348
354
  }
349
355
  });
350
356
 
351
- if ('production' !== process.env.NODE_ENV) {
357
+ if (process.env.NODE_ENV !== 'production') {
352
358
  // Record the root element in case it later gets transplanted.
353
359
  rootElementsByReactRootID[getReactRootID(container)] = getReactRootElementInContainer(container);
354
360
  }
@@ -364,7 +370,7 @@ var ReactMount = {
364
370
  * @return {string} reactRoot ID prefix
365
371
  */
366
372
  _registerComponent: function (nextComponent, container) {
367
- 'production' !== process.env.NODE_ENV ? invariant(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE), '_registerComponent(...): Target container is not a DOM element.') : invariant(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
373
+ !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, '_registerComponent(...): Target container is not a DOM element.') : invariant(false) : undefined;
368
374
 
369
375
  ReactBrowserEventEmitter.ensureScrollValueMonitoring();
370
376
 
@@ -384,7 +390,7 @@ var ReactMount = {
384
390
  // Various parts of our code (such as ReactCompositeComponent's
385
391
  // _renderValidatedComponent) assume that calls to render aren't nested;
386
392
  // verify that that's the case.
387
- 'production' !== process.env.NODE_ENV ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : null;
393
+ process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, '_renderNewRootComponent(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from ' + 'render is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
388
394
 
389
395
  var componentInstance = instantiateReactComponent(nextElement, null);
390
396
  var reactRootID = ReactMount._registerComponent(componentInstance, container);
@@ -395,7 +401,7 @@ var ReactMount = {
395
401
 
396
402
  ReactUpdates.batchedUpdates(batchedMountComponentIntoNode, componentInstance, reactRootID, container, shouldReuseMarkup, context);
397
403
 
398
- if ('production' !== process.env.NODE_ENV) {
404
+ if (process.env.NODE_ENV !== 'production') {
399
405
  // Record the root element in case it later gets transplanted.
400
406
  rootElementsByReactRootID[reactRootID] = getReactRootElementInContainer(container);
401
407
  }
@@ -417,23 +423,26 @@ var ReactMount = {
417
423
  * @return {ReactComponent} Component instance rendered in `container`.
418
424
  */
419
425
  renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
420
- 'production' !== process.env.NODE_ENV ? invariant(parentComponent != null && parentComponent._reactInternalInstance != null, 'parentComponent must be a valid React Component') : invariant(parentComponent != null && parentComponent._reactInternalInstance != null);
426
+ !(parentComponent != null && parentComponent._reactInternalInstance != null) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'parentComponent must be a valid React Component') : invariant(false) : undefined;
421
427
  return ReactMount._renderSubtreeIntoContainer(parentComponent, nextElement, container, callback);
422
428
  },
423
429
 
424
430
  _renderSubtreeIntoContainer: function (parentComponent, nextElement, container, callback) {
425
- 'production' !== process.env.NODE_ENV ? invariant(ReactElement.isValidElement(nextElement), 'React.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
431
+ !ReactElement.isValidElement(nextElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'React.render(): Invalid component element.%s', typeof nextElement === 'string' ? ' Instead of passing an element string, make sure to instantiate ' + 'it by passing it to React.createElement.' : typeof nextElement === 'function' ? ' Instead of passing a component class, make sure to instantiate ' + 'it by passing it to React.createElement.' :
426
432
  // Check if it quacks like an element
427
- nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(ReactElement.isValidElement(nextElement));
433
+ nextElement != null && nextElement.props !== undefined ? ' This may be caused by unintentionally loading two independent ' + 'copies of React.' : '') : invariant(false) : undefined;
428
434
 
429
- 'production' !== process.env.NODE_ENV ? warning(container && container.tagName !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : null;
435
+ process.env.NODE_ENV !== 'production' ? warning(!container || !container.tagName || container.tagName.toUpperCase() !== 'BODY', 'render(): Rendering components directly into document.body is ' + 'discouraged, since its children are often manipulated by third-party ' + 'scripts and browser extensions. This may lead to subtle ' + 'reconciliation issues. Try rendering into a container element created ' + 'for your app.') : undefined;
436
+
437
+ var nextWrappedElement = new ReactElement(TopLevelWrapper, null, null, null, nextElement);
430
438
 
431
439
  var prevComponent = instancesByReactRootID[getReactRootID(container)];
432
440
 
433
441
  if (prevComponent) {
434
- var prevElement = prevComponent._currentElement;
442
+ var prevWrappedElement = prevComponent._currentElement;
443
+ var prevElement = prevWrappedElement.props;
435
444
  if (shouldUpdateReactComponent(prevElement, nextElement)) {
436
- return ReactMount._updateRootComponent(prevComponent, nextElement, container, callback).getPublicInstance();
445
+ return ReactMount._updateRootComponent(prevComponent, nextWrappedElement, container, callback)._renderedComponent.getPublicInstance();
437
446
  } else {
438
447
  ReactMount.unmountComponentAtNode(container);
439
448
  }
@@ -442,12 +451,12 @@ var ReactMount = {
442
451
  var reactRootElement = getReactRootElementInContainer(container);
443
452
  var containerHasReactMarkup = reactRootElement && ReactMount.isRenderedByReact(reactRootElement);
444
453
 
445
- if ('production' !== process.env.NODE_ENV) {
454
+ if (process.env.NODE_ENV !== 'production') {
446
455
  if (!containerHasReactMarkup || reactRootElement.nextSibling) {
447
456
  var rootElementSibling = reactRootElement;
448
457
  while (rootElementSibling) {
449
458
  if (ReactMount.isRenderedByReact(rootElementSibling)) {
450
- 'production' !== process.env.NODE_ENV ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : null;
459
+ process.env.NODE_ENV !== 'production' ? warning(false, 'render(): Target node has markup rendered by React, but there ' + 'are unrelated nodes as well. This is most commonly caused by ' + 'white-space inserted around server-rendered markup.') : undefined;
451
460
  break;
452
461
  }
453
462
 
@@ -457,7 +466,7 @@ var ReactMount = {
457
466
  }
458
467
 
459
468
  var shouldReuseMarkup = containerHasReactMarkup && !prevComponent;
460
- var component = ReactMount._renderNewRootComponent(nextElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject).getPublicInstance();
469
+ var component = ReactMount._renderNewRootComponent(nextWrappedElement, container, shouldReuseMarkup, parentComponent != null ? parentComponent._reactInternalInstance._processChildContext(parentComponent._reactInternalInstance._context) : emptyObject)._renderedComponent.getPublicInstance();
461
470
  if (callback) {
462
471
  callback.call(component);
463
472
  }
@@ -480,35 +489,6 @@ var ReactMount = {
480
489
  return ReactMount._renderSubtreeIntoContainer(null, nextElement, container, callback);
481
490
  },
482
491
 
483
- /**
484
- * Constructs a component instance of `constructor` with `initialProps` and
485
- * renders it into the supplied `container`.
486
- *
487
- * @param {function} constructor React component constructor.
488
- * @param {?object} props Initial props of the component instance.
489
- * @param {DOMElement} container DOM element to render into.
490
- * @return {ReactComponent} Component instance rendered in `container`.
491
- */
492
- constructAndRenderComponent: function (constructor, props, container) {
493
- var element = ReactElement.createElement(constructor, props);
494
- return ReactMount.render(element, container);
495
- },
496
-
497
- /**
498
- * Constructs a component instance of `constructor` with `initialProps` and
499
- * renders it into a container node identified by supplied `id`.
500
- *
501
- * @param {function} componentConstructor React component constructor
502
- * @param {?object} props Initial props of the component instance.
503
- * @param {string} id ID of the DOM element to render into.
504
- * @return {ReactComponent} Component instance rendered in the container node.
505
- */
506
- constructAndRenderComponentByID: function (constructor, props, id) {
507
- var domNode = document.getElementById(id);
508
- 'production' !== process.env.NODE_ENV ? invariant(domNode, 'Tried to get element with id of "%s" but it is not present on the page.', id) : invariant(domNode);
509
- return ReactMount.constructAndRenderComponent(constructor, props, domNode);
510
- },
511
-
512
492
  /**
513
493
  * Registers a container node into which React components will be rendered.
514
494
  * This also creates the "reactRoot" ID that will be assigned to the element
@@ -543,9 +523,9 @@ var ReactMount = {
543
523
  // _renderValidatedComponent) assume that calls to render aren't nested;
544
524
  // verify that that's the case. (Strictly speaking, unmounting won't cause a
545
525
  // render but we still don't expect to be in a render call here.)
546
- 'production' !== process.env.NODE_ENV ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : null;
526
+ process.env.NODE_ENV !== 'production' ? warning(ReactCurrentOwner.current == null, 'unmountComponentAtNode(): Render methods should be a pure function ' + 'of props and state; triggering nested component updates from render ' + 'is not allowed. If necessary, trigger nested updates in ' + 'componentDidUpdate. Check the render method of %s.', ReactCurrentOwner.current && ReactCurrentOwner.current.getName() || 'ReactCompositeComponent') : undefined;
547
527
 
548
- 'production' !== process.env.NODE_ENV ? invariant(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE), 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
528
+ !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'unmountComponentAtNode(...): Target container is not a DOM element.') : invariant(false) : undefined;
549
529
 
550
530
  var reactRootID = getReactRootID(container);
551
531
  var component = instancesByReactRootID[reactRootID];
@@ -555,7 +535,7 @@ var ReactMount = {
555
535
  ReactUpdates.batchedUpdates(unmountComponentFromNode, component, container);
556
536
  delete instancesByReactRootID[reactRootID];
557
537
  delete containersByReactRootID[reactRootID];
558
- if ('production' !== process.env.NODE_ENV) {
538
+ if (process.env.NODE_ENV !== 'production') {
559
539
  delete rootElementsByReactRootID[reactRootID];
560
540
  }
561
541
  return true;
@@ -572,13 +552,13 @@ var ReactMount = {
572
552
  var reactRootID = ReactInstanceHandles.getReactRootIDFromNodeID(id);
573
553
  var container = containersByReactRootID[reactRootID];
574
554
 
575
- if ('production' !== process.env.NODE_ENV) {
555
+ if (process.env.NODE_ENV !== 'production') {
576
556
  var rootElement = rootElementsByReactRootID[reactRootID];
577
557
  if (rootElement && rootElement.parentNode !== container) {
578
- 'production' !== process.env.NODE_ENV ? warning(
558
+ process.env.NODE_ENV !== 'production' ? warning(
579
559
  // Call internalGetID here because getID calls isValid which calls
580
560
  // findReactContainerForID (this function).
581
- internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : null;
561
+ internalGetID(rootElement) === reactRootID, 'ReactMount: Root element ID differed from reactRootID.') : undefined;
582
562
  var containerChild = container.firstChild;
583
563
  if (containerChild && reactRootID === internalGetID(containerChild)) {
584
564
  // If the container has a new child with the same ID as the old
@@ -587,7 +567,7 @@ var ReactMount = {
587
567
  // warning is when the container is empty.
588
568
  rootElementsByReactRootID[reactRootID] = containerChild;
589
569
  } else {
590
- 'production' !== process.env.NODE_ENV ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container:', rootElement.parentNode) : null;
570
+ process.env.NODE_ENV !== 'production' ? warning(false, 'ReactMount: Root element has been removed from its original ' + 'container. New container: %s', rootElement.parentNode) : undefined;
591
571
  }
592
572
  }
593
573
  }
@@ -706,11 +686,11 @@ var ReactMount = {
706
686
 
707
687
  firstChildren.length = 0;
708
688
 
709
- 'production' !== process.env.NODE_ENV ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false);
689
+ !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'findComponentRoot(..., %s): Unable to find element. This probably ' + 'means the DOM was unexpectedly mutated (e.g., by the browser), ' + 'usually due to forgetting a <tbody> when using tables, nesting tags ' + 'like <form>, <p>, or <a>, or using non-SVG elements in an <svg> ' + 'parent. ' + 'Try inspecting the child nodes of the element with React ID `%s`.', targetID, ReactMount.getID(ancestorNode)) : invariant(false) : undefined;
710
690
  },
711
691
 
712
692
  _mountImageIntoNode: function (markup, container, shouldReuseMarkup) {
713
- 'production' !== process.env.NODE_ENV ? invariant(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE), 'mountComponentIntoNode(...): Target container is not valid.') : invariant(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE));
693
+ !(container && (container.nodeType === ELEMENT_NODE_TYPE || container.nodeType === DOC_NODE_TYPE || container.nodeType === DOCUMENT_FRAGMENT_NODE_TYPE)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'mountComponentIntoNode(...): Target container is not valid.') : invariant(false) : undefined;
714
694
 
715
695
  if (shouldReuseMarkup) {
716
696
  var rootElement = getReactRootElementInContainer(container);
@@ -723,18 +703,38 @@ var ReactMount = {
723
703
  var rootMarkup = rootElement.outerHTML;
724
704
  rootElement.setAttribute(ReactMarkupChecksum.CHECKSUM_ATTR_NAME, checksum);
725
705
 
726
- var diffIndex = firstDifferenceIndex(markup, rootMarkup);
727
- var difference = ' (client) ' + markup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
706
+ var normalizedMarkup = markup;
707
+ if (process.env.NODE_ENV !== 'production') {
708
+ // because rootMarkup is retrieved from the DOM, various normalizations
709
+ // will have occurred which will not be present in `markup`. Here,
710
+ // insert markup into a <div> or <iframe> depending on the container
711
+ // type to perform the same normalizations before comparing.
712
+ var normalizer;
713
+ if (container.nodeType === ELEMENT_NODE_TYPE) {
714
+ normalizer = document.createElement('div');
715
+ normalizer.innerHTML = markup;
716
+ normalizedMarkup = normalizer.innerHTML;
717
+ } else {
718
+ normalizer = document.createElement('iframe');
719
+ document.body.appendChild(normalizer);
720
+ normalizer.contentDocument.write(markup);
721
+ normalizedMarkup = normalizer.contentDocument.documentElement.outerHTML;
722
+ document.body.removeChild(normalizer);
723
+ }
724
+ }
725
+
726
+ var diffIndex = firstDifferenceIndex(normalizedMarkup, rootMarkup);
727
+ var difference = ' (client) ' + normalizedMarkup.substring(diffIndex - 20, diffIndex + 20) + '\n (server) ' + rootMarkup.substring(diffIndex - 20, diffIndex + 20);
728
728
 
729
- 'production' !== process.env.NODE_ENV ? invariant(container.nodeType !== DOC_NODE_TYPE, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(container.nodeType !== DOC_NODE_TYPE);
729
+ !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document using ' + 'server rendering but the checksum was invalid. This usually ' + 'means you rendered a different component type or props on ' + 'the client from the one on the server, or your render() ' + 'methods are impure. React cannot handle this case due to ' + 'cross-browser quirks by rendering at the document root. You ' + 'should look for environment dependent code in your components ' + 'and ensure the props are the same client and server side:\n%s', difference) : invariant(false) : undefined;
730
730
 
731
- if ('production' !== process.env.NODE_ENV) {
732
- 'production' !== process.env.NODE_ENV ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : null;
731
+ if (process.env.NODE_ENV !== 'production') {
732
+ process.env.NODE_ENV !== 'production' ? warning(false, 'React attempted to reuse markup in a container but the ' + 'checksum was invalid. This generally means that you are ' + 'using server rendering and the markup generated on the ' + 'server was not what the client was expecting. React injected ' + 'new markup to compensate which works but you have lost many ' + 'of the benefits of server rendering. Instead, figure out ' + 'why the markup being generated is different on the client ' + 'or server:\n%s', difference) : undefined;
733
733
  }
734
734
  }
735
735
  }
736
736
 
737
- 'production' !== process.env.NODE_ENV ? invariant(container.nodeType !== DOC_NODE_TYPE, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See React.renderToString() for server rendering.') : invariant(container.nodeType !== DOC_NODE_TYPE);
737
+ !(container.nodeType !== DOC_NODE_TYPE) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'You\'re trying to render a component to the document but ' + 'you didn\'t use server rendering. We can\'t do this ' + 'without using server rendering due to cross-browser quirks. ' + 'See React.renderToString() for server rendering.') : invariant(false) : undefined;
738
738
 
739
739
  setInnerHTML(container, markup);
740
740
  },
@@ -12,11 +12,11 @@
12
12
 
13
13
  'use strict';
14
14
 
15
- var ReactComponentEnvironment = require("./ReactComponentEnvironment");
16
- var ReactMultiChildUpdateTypes = require("./ReactMultiChildUpdateTypes");
15
+ var ReactComponentEnvironment = require('./ReactComponentEnvironment');
16
+ var ReactMultiChildUpdateTypes = require('./ReactMultiChildUpdateTypes');
17
17
 
18
- var ReactReconciler = require("./ReactReconciler");
19
- var ReactChildReconciler = require("./ReactChildReconciler");
18
+ var ReactReconciler = require('./ReactReconciler');
19
+ var ReactChildReconciler = require('./ReactChildReconciler');
20
20
 
21
21
  /**
22
22
  * Updating children of a component may trigger recursive updates. The depth is
@@ -53,14 +53,14 @@ var markupQueue = [];
53
53
  * @param {number} toIndex Destination index.
54
54
  * @private
55
55
  */
56
- function enqueueMarkup(parentID, markup, toIndex) {
56
+ function enqueueInsertMarkup(parentID, markup, toIndex) {
57
57
  // NOTE: Null values reduce hidden classes.
58
58
  updateQueue.push({
59
59
  parentID: parentID,
60
60
  parentNode: null,
61
61
  type: ReactMultiChildUpdateTypes.INSERT_MARKUP,
62
62
  markupIndex: markupQueue.push(markup) - 1,
63
- textContent: null,
63
+ content: null,
64
64
  fromIndex: null,
65
65
  toIndex: toIndex
66
66
  });
@@ -81,7 +81,7 @@ function enqueueMove(parentID, fromIndex, toIndex) {
81
81
  parentNode: null,
82
82
  type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
83
83
  markupIndex: null,
84
- textContent: null,
84
+ content: null,
85
85
  fromIndex: fromIndex,
86
86
  toIndex: toIndex
87
87
  });
@@ -101,12 +101,32 @@ function enqueueRemove(parentID, fromIndex) {
101
101
  parentNode: null,
102
102
  type: ReactMultiChildUpdateTypes.REMOVE_NODE,
103
103
  markupIndex: null,
104
- textContent: null,
104
+ content: null,
105
105
  fromIndex: fromIndex,
106
106
  toIndex: null
107
107
  });
108
108
  }
109
109
 
110
+ /**
111
+ * Enqueues setting the markup of a node.
112
+ *
113
+ * @param {string} parentID ID of the parent component.
114
+ * @param {string} markup Markup that renders into an element.
115
+ * @private
116
+ */
117
+ function enqueueSetMarkup(parentID, markup) {
118
+ // NOTE: Null values reduce hidden classes.
119
+ updateQueue.push({
120
+ parentID: parentID,
121
+ parentNode: null,
122
+ type: ReactMultiChildUpdateTypes.SET_MARKUP,
123
+ markupIndex: null,
124
+ content: markup,
125
+ fromIndex: null,
126
+ toIndex: null
127
+ });
128
+ }
129
+
110
130
  /**
111
131
  * Enqueues setting the text content.
112
132
  *
@@ -121,7 +141,7 @@ function enqueueTextContent(parentID, textContent) {
121
141
  parentNode: null,
122
142
  type: ReactMultiChildUpdateTypes.TEXT_CONTENT,
123
143
  markupIndex: null,
124
- textContent: textContent,
144
+ content: textContent,
125
145
  fromIndex: null,
126
146
  toIndex: null
127
147
  });
@@ -209,7 +229,7 @@ var ReactMultiChild = {
209
229
  // TODO: The setTextContent operation should be enough
210
230
  for (var name in prevChildren) {
211
231
  if (prevChildren.hasOwnProperty(name)) {
212
- this._unmountChildByName(prevChildren[name], name);
232
+ this._unmountChild(prevChildren[name]);
213
233
  }
214
234
  }
215
235
  // Set new text content.
@@ -227,18 +247,50 @@ var ReactMultiChild = {
227
247
  }
228
248
  },
229
249
 
250
+ /**
251
+ * Replaces any rendered children with a markup string.
252
+ *
253
+ * @param {string} nextMarkup String of markup.
254
+ * @internal
255
+ */
256
+ updateMarkup: function (nextMarkup) {
257
+ updateDepth++;
258
+ var errorThrown = true;
259
+ try {
260
+ var prevChildren = this._renderedChildren;
261
+ // Remove any rendered children.
262
+ ReactChildReconciler.unmountChildren(prevChildren);
263
+ for (var name in prevChildren) {
264
+ if (prevChildren.hasOwnProperty(name)) {
265
+ this._unmountChildByName(prevChildren[name], name);
266
+ }
267
+ }
268
+ this.setMarkup(nextMarkup);
269
+ errorThrown = false;
270
+ } finally {
271
+ updateDepth--;
272
+ if (!updateDepth) {
273
+ if (errorThrown) {
274
+ clearQueue();
275
+ } else {
276
+ processQueue();
277
+ }
278
+ }
279
+ }
280
+ },
281
+
230
282
  /**
231
283
  * Updates the rendered children with new children.
232
284
  *
233
- * @param {?object} nextNestedChildren Nested child maps.
285
+ * @param {?object} nextNestedChildrenElements Nested child element maps.
234
286
  * @param {ReactReconcileTransaction} transaction
235
287
  * @internal
236
288
  */
237
- updateChildren: function (nextNestedChildren, transaction, context) {
289
+ updateChildren: function (nextNestedChildrenElements, transaction, context) {
238
290
  updateDepth++;
239
291
  var errorThrown = true;
240
292
  try {
241
- this._updateChildren(nextNestedChildren, transaction, context);
293
+ this._updateChildren(nextNestedChildrenElements, transaction, context);
242
294
  errorThrown = false;
243
295
  } finally {
244
296
  updateDepth--;
@@ -256,14 +308,14 @@ var ReactMultiChild = {
256
308
  * Improve performance by isolating this hot code path from the try/catch
257
309
  * block in `updateChildren`.
258
310
  *
259
- * @param {?object} nextNestedChildren Nested child maps.
311
+ * @param {?object} nextNestedChildrenElements Nested child element maps.
260
312
  * @param {ReactReconcileTransaction} transaction
261
313
  * @final
262
314
  * @protected
263
315
  */
264
- _updateChildren: function (nextNestedChildren, transaction, context) {
316
+ _updateChildren: function (nextNestedChildrenElements, transaction, context) {
265
317
  var prevChildren = this._renderedChildren;
266
- var nextChildren = ReactChildReconciler.updateChildren(prevChildren, nextNestedChildren, transaction, context);
318
+ var nextChildren = ReactChildReconciler.updateChildren(prevChildren, nextNestedChildrenElements, transaction, context);
267
319
  this._renderedChildren = nextChildren;
268
320
  if (!nextChildren && !prevChildren) {
269
321
  return;
@@ -287,7 +339,7 @@ var ReactMultiChild = {
287
339
  if (prevChild) {
288
340
  // Update `lastIndex` before `_mountIndex` gets unset by unmounting.
289
341
  lastIndex = Math.max(prevChild._mountIndex, lastIndex);
290
- this._unmountChildByName(prevChild, name);
342
+ this._unmountChild(prevChild);
291
343
  }
292
344
  // The child must be instantiated before it's mounted.
293
345
  this._mountChildByNameAtIndex(nextChild, name, nextIndex, transaction, context);
@@ -297,7 +349,7 @@ var ReactMultiChild = {
297
349
  // Remove children that are no longer present.
298
350
  for (name in prevChildren) {
299
351
  if (prevChildren.hasOwnProperty(name) && !(nextChildren && nextChildren.hasOwnProperty(name))) {
300
- this._unmountChildByName(prevChildren[name], name);
352
+ this._unmountChild(prevChildren[name]);
301
353
  }
302
354
  }
303
355
  },
@@ -339,7 +391,7 @@ var ReactMultiChild = {
339
391
  * @protected
340
392
  */
341
393
  createChild: function (child, mountImage) {
342
- enqueueMarkup(this._rootNodeID, mountImage, child._mountIndex);
394
+ enqueueInsertMarkup(this._rootNodeID, mountImage, child._mountIndex);
343
395
  },
344
396
 
345
397
  /**
@@ -362,6 +414,16 @@ var ReactMultiChild = {
362
414
  enqueueTextContent(this._rootNodeID, textContent);
363
415
  },
364
416
 
417
+ /**
418
+ * Sets this markup string.
419
+ *
420
+ * @param {string} markup Markup to set.
421
+ * @protected
422
+ */
423
+ setMarkup: function (markup) {
424
+ enqueueSetMarkup(this._rootNodeID, markup);
425
+ },
426
+
365
427
  /**
366
428
  * Mounts a child with the supplied name.
367
429
  *
@@ -382,15 +444,14 @@ var ReactMultiChild = {
382
444
  },
383
445
 
384
446
  /**
385
- * Unmounts a rendered child by name.
447
+ * Unmounts a rendered child.
386
448
  *
387
449
  * NOTE: This is part of `updateChildren` and is here for readability.
388
450
  *
389
451
  * @param {ReactComponent} child Component to unmount.
390
- * @param {string} name Name of the child in `this._renderedChildren`.
391
452
  * @private
392
453
  */
393
- _unmountChildByName: function (child, name) {
454
+ _unmountChild: function (child) {
394
455
  this.removeChild(child);
395
456
  child._mountIndex = null;
396
457
  }