Skip to content

Commit

Permalink
fix: Attempted to assign to readonly property (#1813)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadfsalameh authored Nov 26, 2024
1 parent 594555c commit 2d00f34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/TransWithoutContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ 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];
const componentKey = components[c].key || c;
const comp = cloneElement(components[c], { key: componentKey });
if (
typeof comp.type === 'function' ||
!comp.props ||
Expand Down

0 comments on commit 2d00f34

Please sign in to comment.