mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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:
committed by
Paul O’Shannessy
parent
9687b35d83
commit
d7a6c95464
@@ -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