Skip to content

Commit

Permalink
fix: remove useCallback in functional autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
Atala committed Oct 14, 2024
1 parent fc83756 commit 1e1eee4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/AddressAutocomplete/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ function AddressAutocomplete(props) {

const fuse = new Fuse(addresses, fuseOptions);

const autocomplete = useCallback(
_.debounce((text, query) => {
const autocomplete = _.debounce((text, query) => {
const newController = new AbortController();
setController(newController);
const fuseResults = fuse.search(text, { limit: 2 });
Expand Down Expand Up @@ -136,9 +135,7 @@ function AddressAutocomplete(props) {
console.log('AddressAutocomplete; _autocomplete', error);
});
}
}, 300),
[country, postcode, fuse],
);
}, 300);

function onChangeText(text) {
if (controller) {
Expand Down

0 comments on commit 1e1eee4

Please sign in to comment.