diff --git a/packages/react-devtools-shared/src/hydration.js b/packages/react-devtools-shared/src/hydration.js index 69909cb2f6..2c2d696089 100644 --- a/packages/react-devtools-shared/src/hydration.js +++ b/packages/react-devtools-shared/src/hydration.js @@ -243,23 +243,21 @@ export function dehydrate( : data.constructor.name, }; - if (typeof data[Symbol.iterator]) { - // TRICKY - // Don't use [...spread] syntax for this purpose. - // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. - // Other types (e.g. typed arrays, Sets) will not spread correctly. - Array.from(data).forEach( - (item, i) => - (unserializableValue[i] = dehydrate( - item, - cleaned, - unserializable, - path.concat([i]), - isPathAllowed, - isPathAllowedCheck ? 1 : level + 1, - )), - ); - } + // TRICKY + // Don't use [...spread] syntax for this purpose. + // This project uses @babel/plugin-transform-spread in "loose" mode which only works with Array values. + // Other types (e.g. typed arrays, Sets) will not spread correctly. + Array.from(data).forEach( + (item, i) => + (unserializableValue[i] = dehydrate( + item, + cleaned, + unserializable, + path.concat([i]), + isPathAllowed, + isPathAllowedCheck ? 1 : level + 1, + )), + ); unserializable.push(path);