From d7a6c95464ead9e9855dfc590c5908ca994a0d6a Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Tue, 5 Jul 2016 09:18:49 -0700 Subject: [PATCH] [flow] fix flattenChildren type (#7110) Summary: Make the debug attribute optional Test Plan: npm run flow Reviewers: @keyanzhang @chicoxyzzy (cherry picked from commit 07cfba17a9902e9072b9b73c17a375b2f6b53817) --- src/shared/utils/flattenChildren.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/shared/utils/flattenChildren.js b/src/shared/utils/flattenChildren.js index afb12d5a46..bd9d07ece6 100644 --- a/src/shared/utils/flattenChildren.js +++ b/src/shared/utils/flattenChildren.js @@ -27,7 +27,7 @@ function flattenSingleChildIntoContext( traverseContext: mixed, child: ReactElement, name: string, - selfDebugID: number + selfDebugID?: number, ): void { // We found a component instance. if (traverseContext && typeof traverseContext === 'object') { @@ -54,7 +54,10 @@ function flattenSingleChildIntoContext( * children will not be included in the resulting object. * @return {!object} flattened children keyed by name. */ -function flattenChildren(children: ReactElement, selfDebugID: number): ?{ [name: string]: ReactElement } { +function flattenChildren( + children: ReactElement, + selfDebugID?: number, +): ?{ [name: string]: ReactElement } { if (children == null) { return children; }