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 string;
  }
}
 Attempts to mimic Chrome's inline preview for values.
 For example, the following value...
   {
      foo: 123,
      bar: "abc",
      baz: [true, false],
      qux: { ab: 1, cd: 2 }
   };
 Would show a preview of...
   {foo: 123, bar: "abc", baz: Array(2), qux: {…}}
 And the following value...
   [
     123,
     "abc",
     [true, false],
     { foo: 123, bar: "abc" }
   ];
 Would show a preview of...
   [123, "abc", Array(2), {…}]
export function formatDataForPreview(
  data: any,
  showFormattedValue: boolean,
): string {
  if (data != null && hasOwnProperty.call(data, meta.type)) {
    return showFormattedValue
      ? data[meta.preview_long]
      : data[meta.preview_short];