Fix some typos in dumpReactTree.js (#19636)

Summary:
Simple doc fixes
Closes https://github.com/facebook/react-native/pull/19636

Differential Revision: D8344481

Pulled By: TheSavior

fbshipit-source-id: b6fa064f70793bdaf1d6346b2775373b74c2ae3b
This commit is contained in:
Felix Yan 2018-06-09 20:07:08 -07:00 committed by Facebook Github Bot
parent ad67f556fb
commit 5fbb307e24
1 changed files with 5 additions and 5 deletions

View File

@ -51,14 +51,14 @@ function getReactTree() {
}
/*
function dumpNode(node: Object, identation: number) {
function dumpNode(node: Object, indentation: number) {
const data = getReactData(node);
if (data.nodeType === 'Text') {
return indent(identation) + data.text + '\n';
return indent(indentation) + data.text + '\n';
} else if (data.nodeType === 'Empty') {
return '';
}
let output = indent(identation) + `<${data.name}`;
let output = indent(indentation) + `<${data.name}`;
if (data.nodeType === 'Composite') {
for (const propName of Object.getOwnPropertyNames(data.props || {})) {
if (isNormalProp(propName)) {
@ -76,11 +76,11 @@ function dumpNode(node: Object, identation: number) {
}
let childOutput = '';
for (const child of data.children || []) {
childOutput += dumpNode(child, identation + 1);
childOutput += dumpNode(child, indentation + 1);
}
if (childOutput) {
output += '>\n' + childOutput + indent(identation) + `</${data.name}>\n`;
output += '>\n' + childOutput + indent(indentation) + `</${data.name}>\n`;
} else {
output += ' />\n';
}