mirror of
https://github.com/hanzoai/react.git
synced 2026-09-24 17:02:27 +00:00
[flow] fix flattenChildren type (#7110)
Summary: Make the debug attribute optional Test Plan: npm run flow Reviewers: @keyanzhang @chicoxyzzy
This commit is contained in:
committed by
GitHub
parent
f208b8d741
commit
677097445b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user