fix: resolved issue with region selector and all regions value (#3652)

pull/3653/head
Brandon Cohen 1 year ago committed by GitHub
parent c84ca43074
commit 28a2c50495
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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]);

Loading…
Cancel
Save