mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
ae612e646174bb3242f8fb7c4c416d1876d0108c
key Warning for Flattened Positional Children (#29662)
## Summary https://github.com/facebook/react/pull/29088 introduced a regression triggering this warning when rendering flattened positional children: > Each child in a list should have a unique "key" prop. The specific scenario that triggers this is when rendering multiple positional children (which do not require unique `key` props) after flattening them with one of the `React.Children` utilities (e.g. `React.Children.toArray`). The refactored logic in `React.Children` incorrectly drops the `element._store.validated` property in `__DEV__`. This diff fixes the bug and introduces a unit test to prevent future regressions. ## How did you test this change? ``` $ yarn test ReactChildren-test.js ``` DiffTrain build for commit https://github.com/facebook/react/commit/72644ef2f2ec7a274f79f6b32320d62757521329.
react-fbsource-import
Languages
JavaScript
67.1%
TypeScript
29.4%
HTML
1.5%
CSS
1.1%
C++
0.6%
Other
0.2%