[flow] fix flattenChildren type (#7110)

Summary:
Make the debug attribute optional

Test Plan:
npm run flow

Reviewers: @keyanzhang @chicoxyzzy
(cherry picked from commit 07cfba17a9)
This commit is contained in:
Christopher Chedeau
2016-07-08 10:48:57 -07:00
committed by Paul O’Shannessy
parent 9687b35d83
commit d7a6c95464
+5 -2
View File
@@ -27,7 +27,7 @@ function flattenSingleChildIntoContext(
traverseContext: mixed,
child: ReactElement<any>,
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<any>, selfDebugID: number): ?{ [name: string]: ReactElement<any> } {
function flattenChildren(
children: ReactElement<any>,
selfDebugID?: number,
): ?{ [name: string]: ReactElement<any> } {
if (children == null) {
return children;
}