Skip to content

Commit

Permalink
[devtools] Fix can't expand in some scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
iChenLei committed Jan 2, 2021
1 parent 50393dc commit 51ce7c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/react-devtools-shared/src/hydration.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,9 @@ export function hydrate(

const value = parent[last];

if (value.type === 'infinity') {
if (!value) {
return;
} else if (value.type === 'infinity') {
parent[last] = Infinity;
} else if (value.type === 'nan') {
parent[last] = NaN;
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-shared/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function getAllEnumerableKeys(
});
current = Object.getPrototypeOf(current);
}
return keys;
return [...new Set(keys)];
}

export function getDisplayName(
Expand Down

0 comments on commit 51ce7c0

Please sign in to comment.