Skip to content

Commit

Permalink
Key warnings are no longer associated with a component in the tree
Browse files Browse the repository at this point in the history
Key warnings are supposed to be associated with the child missing the key.
It was previously associated with the owner of the parent element which is
not really as useful but now it's unfortunately associated with a fake
fiber which disappears.
  • Loading branch information
sebmarkbage committed May 21, 2024
1 parent 036aec4 commit 35aa080
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2562,13 +2562,7 @@ describe('InspectedElement', () => {
const data = await getErrorsAndWarningsForElementAtIndex(0);
expect(data).toMatchInlineSnapshot(`
{
"errors": [
[
"Warning: Each child in a list should have a unique "key" prop. See https://react.dev/link/warning-keys for more information.
at Example",
1,
],
],
"errors": [],
"warnings": [],
}
`);
Expand Down
3 changes: 1 addition & 2 deletions packages/react-devtools-shared/src/__tests__/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1932,9 +1932,8 @@ describe('Store', () => {
);

expect(store).toMatchInlineSnapshot(`
✕ 1, ⚠ 0
[root]
▾ <Example>
▾ <Example>
<Child>
`);
});
Expand Down

0 comments on commit 35aa080

Please sign in to comment.