mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
Patch up for future React Sync
Reviewed By: spicyj, bvaughn Differential Revision: D4523259 fbshipit-source-id: 317a26ce3e9e48553a7f7c856dd6b48038b4b2ea
This commit is contained in:
committed by
Facebook Github Bot
parent
1ab104a759
commit
c3b25c9059
@@ -11,12 +11,13 @@
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
const ReactNativeMount = require('ReactNativeMount');
|
||||
/*
|
||||
const getReactData = require('getReactData');
|
||||
|
||||
const INDENTATION_SIZE = 2;
|
||||
const MAX_DEPTH = 2;
|
||||
const MAX_STRING_LENGTH = 50;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Dump all React Native root views and their content. This function tries
|
||||
@@ -32,6 +33,12 @@ function dumpReactTree() {
|
||||
}
|
||||
|
||||
function getReactTree() {
|
||||
// TODO(sema): Reenable tree dumps using the Fiber tree structure. #15945684
|
||||
return (
|
||||
'React tree dumps have been temporarily disabled while React is ' +
|
||||
'upgraded to Fiber.'
|
||||
);
|
||||
/*
|
||||
let output = '';
|
||||
const rootIds = Object.getOwnPropertyNames(ReactNativeMount._instancesByContainerID);
|
||||
for (const rootId of rootIds) {
|
||||
@@ -41,8 +48,10 @@ function getReactTree() {
|
||||
output += `============ End root ID: ${rootId} ============\n`;
|
||||
}
|
||||
return output;
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
function dumpNode(node: Object, identation: number) {
|
||||
const data = getReactData(node);
|
||||
if (data.nodeType === 'Text') {
|
||||
@@ -101,7 +110,6 @@ function convertObject(object: Object, depth: number) {
|
||||
if (!first) {
|
||||
output += ', ';
|
||||
}
|
||||
// $FlowFixMe(>=0.28.0)
|
||||
output += `${key}: ${convertValue(object[key], depth + 1)}`;
|
||||
first = false;
|
||||
}
|
||||
@@ -139,5 +147,6 @@ function possiblyEllipsis(value: string) {
|
||||
function indent(size: number) {
|
||||
return ' '.repeat(size * INDENTATION_SIZE);
|
||||
}
|
||||
*/
|
||||
|
||||
module.exports = dumpReactTree;
|
||||
|
||||
Reference in New Issue
Block a user