Skip to content

Commit

Permalink
fix: Attempted to assign to readonly property
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadfsalameh committed Nov 22, 2024
1 parent c9a73eb commit b02ffef
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 b02ffef

Please sign in to comment.