@samitouri / QOS-React / commits / 07cfba17a9

[flow] fix flattenChildren type (#7110)

Summary: Make the debug attribute optional Test Plan: npm run flow Reviewers: @keyanzhang @chicoxyzzy

Christopher Chedeau committed Jul 5, 2016 at 09:18 UTC 07cfba17a9902e9072b9b73c17a375b2f6b53817
1 file changed +5 -2
src/shared/utils/flattenChildren.js
+5 -2
@@ -27,7 +27,7 @@ function flattenSingleChildIntoContext(
27 traverseContext: mixed,
28 child: ReactElement<any>,
29 name: string,
30 - selfDebugID: number
30 + selfDebugID?: number,
31 ): void {
32 // We found a component instance.
33 if (traverseContext && typeof traverseContext === 'object') {
@@ -54,7 +54,10 @@ function flattenSingleChildIntoContext(
54 * children will not be included in the resulting object.
55 * @return {!object} flattened children keyed by name.
56 */
57 -function flattenChildren(children: ReactElement<any>, selfDebugID: number): ?{ [name: string]: ReactElement<any> } {
57 +function flattenChildren(
58 + children: ReactElement<any>,
59 + selfDebugID?: number,
60 +): ?{ [name: string]: ReactElement<any> } {
61 if (children == null) {
62 return children;
63 }