https://github.com/facebook/react/blob/49af88991c3a3e79e663e495458fad12d3162894/packages/react-devtools-shared/src/utils.js#L491

We have SuspenseList for the tree view but not when printing JSX.

When we fallthrough here we call getDisplayName with a symbol, because we assume that if it's not a string, then it's a function. We should be checking whether it is a function before calling getDisplayName.

Subsequently if we call getDisplayName with a symbol we get the error `invalid value used as weak map key` which messes up things after that. I think that's the actual cause of https://github.com/facebook/react/pull/19364
return 'Lazy';
    case Memo:
      return 'Memo';
    case Portal:
      return 'Portal';
    case Profiler:
      return 'Profiler';
    case StrictMode:
      return 'StrictMode';
    case Suspense:
      return 'Suspense';
    default:
      const {type} = element;
      if (typeof type === 'string') {
        return type;
      } else if (type != null) {
        return getDisplayName(type, 'Anonymous');
      } else {
        return 'Element';
      }
  }
}
const MAX_PREVIEW_STRING_LENGTH = 50;
function truncateForDisplay(
  string: string,
  length: number = MAX_PREVIEW_STRING_LENGTH,
) {
  if (string.length > length) {
    return string.substr(0, length) + '…';
  } else {