From 2b3d5c24a4cdb2855174059109e8f66bcf35945e Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 20 Nov 2024 12:01:43 -0600 Subject: [PATCH] fix(location-field): remove usecallbacks --- packages/location-field/src/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/location-field/src/index.tsx b/packages/location-field/src/index.tsx index 748820c4f..30d655654 100644 --- a/packages/location-field/src/index.tsx +++ b/packages/location-field/src/index.tsx @@ -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 => { @@ -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; @@ -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; @@ -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;