Skip to content

Commit 5a9ea03

Browse files
committed
Avoid double translation in <UpdateWithConfirmButton>
1 parent ae8d4b5 commit 5a9ea03

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/ra-ui-materialui/src/button/UpdateWithConfirmButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ export const UpdateWithConfirmButton = <
182182
<Fragment>
183183
<StyledButton
184184
onClick={handleClick}
185-
label={label}
185+
// avoid double translation
186+
label={<>{label}</>}
186187
// If users provide a ReactNode as label, its their responsibility to also provide an aria-label should they need it
187188
aria-label={typeof label === 'string' ? label : undefined}
188189
{...sanitizeRestProps(rest)}

packages/ra-ui-materialui/src/button/UpdateWithUndoButton.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export const UpdateWithUndoButton = (inProps: UpdateWithUndoButtonProps) => {
127127
return (
128128
<StyledButton
129129
onClick={handleClick}
130+
// avoid double translation
130131
label={<>{label}</>}
131132
// If users provide a ReactNode as label, its their responsibility to also provide an aria-label should they need it
132133
aria-label={typeof label === 'string' ? label : undefined}

0 commit comments

Comments
 (0)