dillon1000/react

Commit

Fix Missing `key` Validation in `React.Children` (#29675)

## Summary

In https://github.com/facebook/react/pull/29088, the validation logic
for `React.Children` inspected whether `mappedChild` — the return value
of the map callback — has a valid `key`. However, this deviates from
existing behavior which only warns if the original `child` is missing a
required `key`.

This fixes false positive `key` validation warnings when using
`React.Children`, by validating the original `child` instead of
`mappedChild`.

This is a more general fix that expands upon my previous fix in
https://github.com/facebook/react/pull/29662.

## How did you test this change?

```
$ yarn test ReactChildren-test.js
```
Browse files
Changed paths2 files
First-parent comparison
M packages/react/src/ReactChildren.js ModifiedM packages/react/src/__tests__/ReactChildren-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…