Skip to content

Commit 07390ae

Browse files
fix: remove incorrect array destructuring in mobile search (#2124)
The search was crashing because of incorrect array destructuring on the useDebounce hook return value. useDebounce returns a string, not an array, so using `const [query] = useDebounce(...)` caused query to be undefined when the search string was empty. This resulted in passing { text: undefined } to the tRPC endpoint, which failed Zod validation expecting a string. Fixed by removing the array destructuring: const query = useDebounce(...) Co-authored-by: Claude <[email protected]>
1 parent c34f70d commit 07390ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/mobile/app/dashboard/search.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const MAX_DISPLAY_SUGGESTIONS = 5;
1919
export default function Search() {
2020
const [search, setSearch] = useState("");
2121

22-
const [query] = useDebounce(search, 10);
22+
const query = useDebounce(search, 10);
2323
const inputRef = useRef<TextInput>(null);
2424

2525
const [isInputFocused, setIsInputFocused] = useState(true);

0 commit comments

Comments
 (0)