Skip to content

Commit

Permalink
fixed type on address component
Browse files Browse the repository at this point in the history
  • Loading branch information
jessherlitz committed Aug 17, 2024
1 parent 3eab966 commit 50eb7ed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/ui/src/components/address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const COUNTRIES: Country[] = [
{ abbreviation: 'US', name: 'United States' },
];

const mapCountryAbbreviationToStates = {
const mapCountryAbbreviationToStates: Record<string, State[]> = {
CA: CA_PROVINCES,
US: USA_STATES,
};
Expand All @@ -163,7 +163,10 @@ Address.Country = function Country(props: SelectProps) {
const { setCountryAbbreviation } = useContext(AddressContext);

return (
<Select {...props} onChange={(e) => setCountryAbbreviation(e.target.value)}>
<Select
{...props}
onChange={(e) => setCountryAbbreviation(e.currentTarget.value)}
>
{COUNTRIES.map((country: Country) => {
return (
<option key={country.abbreviation} value={country.abbreviation}>
Expand Down

0 comments on commit 50eb7ed

Please sign in to comment.