mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-06 22:44:22 +08:00
[Children] Expose React.Children like web React
Summary: Simply exposes this public API from ReactIOS in the same manner as web React. Closes https://github.com/facebook/react-native/pull/104 Github Author: James Ide <ide@jameside.com> Test Plan: Imported from GitHub, without a `Test Plan:` line.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var ReactChildren = require('ReactChildren');
|
||||
var ReactComponent = require('ReactComponent');
|
||||
var ReactCompositeComponent = require('ReactCompositeComponent');
|
||||
var ReactContext = require('ReactContext');
|
||||
@@ -20,6 +21,7 @@ var ReactPropTypes = require('ReactPropTypes');
|
||||
|
||||
var deprecated = require('deprecated');
|
||||
var invariant = require('invariant');
|
||||
var onlyChild = require('onlyChild');
|
||||
|
||||
ReactIOSDefaultInjection.inject();
|
||||
|
||||
@@ -73,6 +75,12 @@ var render = function(component, mountInto) {
|
||||
|
||||
var ReactIOS = {
|
||||
hasReactIOSInitialized: false,
|
||||
Children: {
|
||||
map: ReactChildren.map,
|
||||
forEach: ReactChildren.forEach,
|
||||
count: ReactChildren.count,
|
||||
only: onlyChild
|
||||
},
|
||||
PropTypes: ReactPropTypes,
|
||||
createClass: ReactCompositeComponent.createClass,
|
||||
createElement: createElement,
|
||||
|
||||
Reference in New Issue
Block a user