Skip to content

Commit

Permalink
fix: <Trans /> warns 'Each child in a list should have a unique "ke…
Browse files Browse the repository at this point in the history
…y" prop.' (#1806)
  • Loading branch information
aiktb authored Oct 21, 2024
1 parent 9569f9f commit e05425e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/TransWithoutContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ export function Trans({

if (components) {
Object.keys(components).forEach((c) => {
if (!components[c].key) components[c] = cloneElement(components[c], { key: c });
const comp = components[c];
if (
typeof comp.type === 'function' ||
Expand Down

0 comments on commit e05425e

Please sign in to comment.