Skip to content

Commit

Permalink
Merge pull request #797 from ibi-group/remove-bad-callbacks
Browse files Browse the repository at this point in the history
fix(location-field): remove usecallbacks
  • Loading branch information
amy-corson-ibigroup authored Nov 20, 2024
2 parents c65c57e + 2b3d5c2 commit 9336207
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/location-field/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const renderFeature = (
const { main, secondary } = generateLabel(feature.properties);

// Create the selection handler
const locationSelected = useCallback(() => {
const locationSelected = () => {
getGeocoder(geocoderConfig)
.getLocationFromGeocodedFeature(feature)
.then(geocodedLocation => {
Expand All @@ -182,7 +182,7 @@ const renderFeature = (
// populate the sessionSearches array.
addLocationSearch({ location: geocodedLocation });
});
}, []);
};

// Add to the selection handler lookup (for use in onKeyDown)
locationSelectedLookup[itemIndex] = locationSelected;
Expand Down Expand Up @@ -855,9 +855,9 @@ const LocationField = ({
};

// Create the location selected handler
const locationSelected = useCallback(() => {
const locationSelected = () => {
setLocation(stopLocation, "STOP");
}, []);
};

// Add to the selection handler lookup (for use in onKeyDown)
locationSelectedLookup[itemIndex] = locationSelected;
Expand Down Expand Up @@ -898,9 +898,9 @@ const LocationField = ({
menuItems = menuItems.concat(
sessionSearches.map(sessionLocation => {
// Create the location-selected handler
const locationSelected = useCallback(() => {
const locationSelected = () => {
setLocation(sessionLocation, "SESSION");
}, []);
};

// Add to the selection handler lookup (for use in onKeyDown)
locationSelectedLookup[itemIndex] = locationSelected;
Expand Down

0 comments on commit 9336207

Please sign in to comment.