Skip to content

Commit 3af881d

Browse files
kitfunsoclaude
andcommitted
Add key prop to CurrencySelector to force re-render on value change
Forces Preact to re-create the select element when currency changes, ensuring the displayed value matches the controlled value prop. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b1d6fcf commit 3af881d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/components/ui/calculator/CurrencySelector.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export function CurrencySelector({ value, onChange, className = '' }: CurrencySe
8181

8282
return (
8383
<select
84+
key={`currency-select-${value}`}
8485
value={value}
8586
onChange={(e) => handleChange(e.currentTarget.value as Currency)}
8687
className={`

0 commit comments

Comments
 (0)