mirror of
https://github.com/facebook/react.git
synced 2026-02-22 03:42:05 +00:00
[Flight] Also don't cut off type and key (#31209)
This commit is contained in:
committed by
GitHub
parent
147374d71a
commit
cd22717c27
@@ -1364,10 +1364,8 @@ function parseModelString(
|
||||
// happened.
|
||||
Object.defineProperty(parentObject, key, {
|
||||
get: function () {
|
||||
// We intentionally don't throw an error object here because it looks better
|
||||
// without the stack in the console which isn't useful anyway.
|
||||
// eslint-disable-next-line no-throw-literal
|
||||
throw (
|
||||
// TODO: We should ideally throw here to indicate a difference.
|
||||
return (
|
||||
'This object has been omitted by React in the console log ' +
|
||||
'to avoid sending too much data from the server. Try logging smaller ' +
|
||||
'or more specific objects.'
|
||||
|
||||
11
packages/react-server/src/ReactFlightServer.js
vendored
11
packages/react-server/src/ReactFlightServer.js
vendored
@@ -3465,7 +3465,18 @@ function renderConsoleValue(
|
||||
if (element._owner != null) {
|
||||
outlineComponentInfo(request, element._owner);
|
||||
}
|
||||
if (typeof element.type === 'object' && element.type !== null) {
|
||||
// If the type is an object it can get cut off which shouldn't happen here.
|
||||
doNotLimit.add(element.type);
|
||||
}
|
||||
if (typeof element.key === 'object' && element.key !== null) {
|
||||
// This should never happen but just in case.
|
||||
doNotLimit.add(element.key);
|
||||
}
|
||||
doNotLimit.add(element.props);
|
||||
if (element._owner !== null) {
|
||||
doNotLimit.add(element._owner);
|
||||
}
|
||||
|
||||
if (enableOwnerStacks) {
|
||||
let debugStack: null | ReactStackTrace = null;
|
||||
|
||||
Reference in New Issue
Block a user