From 2069a7a9d00291266fef763c6817b3bdd3ed4707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D5=A1=D3=84=D5=A1?= Date: Tue, 4 Jun 2024 20:19:17 +0800 Subject: [PATCH] fix(autocomplete): maximum update depth exceeded in autocomplete (#3175) --- .changeset/tough-peaches-live.md | 5 +++++ packages/components/autocomplete/src/use-autocomplete.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tough-peaches-live.md diff --git a/.changeset/tough-peaches-live.md b/.changeset/tough-peaches-live.md new file mode 100644 index 0000000000..ceda7e97b6 --- /dev/null +++ b/.changeset/tough-peaches-live.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/autocomplete": patch +--- + +Fix maximum update depth exceeded on Autocomplete component (#3094) diff --git a/packages/components/autocomplete/src/use-autocomplete.ts b/packages/components/autocomplete/src/use-autocomplete.ts index 83e8a8caea..68019369cf 100644 --- a/packages/components/autocomplete/src/use-autocomplete.ts +++ b/packages/components/autocomplete/src/use-autocomplete.ts @@ -318,7 +318,7 @@ export function useAutocomplete(originalProps: UseAutocomplete state.setSelectedKey(key); state.setInputValue(item.textValue); } - }, [inputRef.current, state]); + }, [inputRef.current]); // apply the same with to the popover as the select useEffect(() => {