@samitouri / QOS-React-2 / commits / 3cf14e8f9b

Remove ReactChildren methods from React object

These are not terribly useful on this object and the naming of `React.forEachChildren` sucked anyway.

Paul O'Shannessy committed Sep 5, 2013 at 18:34 UTC 3cf14e8f9b14ac05bcd24634daa26ac6772bd31b
2 files changed +4 -7
src/addons/transitions/ReactTransitionKeySet.js
+4 -4
@@ -19,20 +19,20 @@
19
20 "use strict";
21
22 -var React = require('React');
22 +var ReactChildren = require('ReactChildren');
23
24 var MERGE_KEY_SETS_TAIL_SENTINEL = {};
25
26 var ReactTransitionKeySet = {
27 /**
28 * Given `this.props.children`, return an object mapping key to child. Just
29 - * simple syntactic sugar around React.mapChildren().
29 + * simple syntactic sugar around ReactChildren.map().
30 *
31 * @param {*} children `this.props.children`
32 * @return {object} Mapping of key to child
33 */
34 getChildMapping: function(children) {
35 - return React.mapChildren(children, function(child) {
35 + return ReactChildren.map(children, function(child) {
36 return child;
37 });
38 },
@@ -45,7 +45,7 @@ var ReactTransitionKeySet = {
45 * @return {object} Mapping of key to the value "true"
46 */
47 getKeySet: function(children) {
48 - return React.mapChildren(children, function() {
48 + return ReactChildren.map(children, function() {
49 return true;
50 });
51 },
src/core/React.js
-3
@@ -18,7 +18,6 @@
18
19 "use strict";
20
21 -var ReactChildren = require('ReactChildren');
21 var ReactCompositeComponent = require('ReactCompositeComponent');
22 var ReactComponent = require('ReactComponent');
23 var ReactDOM = require('ReactDOM');
@@ -40,8 +39,6 @@ var React = {
39 createClass: ReactCompositeComponent.createClass,
40 constructAndRenderComponent: ReactMount.constructAndRenderComponent,
41 constructAndRenderComponentByID: ReactMount.constructAndRenderComponentByID,
43 - forEachChildren: ReactChildren.forEach,
44 - mapChildren: ReactChildren.map,
42 renderComponent: ReactPerf.measure(
43 'React',
44 'renderComponent',