Skip to content

Commit

Permalink
fix: resolved issue with region selector and all regions value (#3652)
Browse files Browse the repository at this point in the history
  • Loading branch information
OwsleyJr committed Oct 19, 2023
1 parent c84ca43 commit 28a2c50
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/RegionSelector/index.tsx
Expand Up @@ -76,8 +76,12 @@ const RegionSelector = ({
}, [value, regions, allRegion]);

useEffect(() => {
if (onChange && regions && selectedRegion) {
onChange(name, selectedRegion.iso_3166_1);
if (onChange && regions) {
if (selectedRegion) {
onChange(name, selectedRegion.iso_3166_1);
} else {
onChange(name, '');
}
}
}, [onChange, selectedRegion, name, regions]);

Expand Down

0 comments on commit 28a2c50

Please sign in to comment.