mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Write typings for React.Children.toArray and React.Children.map
This commit is contained in:
@@ -328,11 +328,12 @@ var ContextTypesSpecification: React.ComponentSpec<any, any> = {
|
||||
// React.Children
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
var childMap: { [key: string]: number } =
|
||||
var mappedChildrenArray: number[] =
|
||||
React.Children.map<number>(children, (child) => { return 42; });
|
||||
React.Children.forEach(children, (child) => {});
|
||||
var nChildren: number = React.Children.count(children);
|
||||
var onlyChild = React.Children.only([null, [[["Hallo"], true]], false]);
|
||||
var childrenToArray: React.ReactChild[] = React.Children.toArray(children);
|
||||
|
||||
//
|
||||
// Example from http://facebook.github.io/react/
|
||||
|
||||
Reference in New Issue
Block a user