diff --git a/site/src/examples/combo-box/ServerSideData.tsx b/site/src/examples/combo-box/ServerSideData.tsx index 3e9e1186862..56e3a96782b 100644 --- a/site/src/examples/combo-box/ServerSideData.tsx +++ b/site/src/examples/combo-box/ServerSideData.tsx @@ -23,8 +23,9 @@ const fetcher = async (url: string, filter: string) => { export const ServerSideData = (): ReactElement => { const [value, setValue] = useState(""); + const minLengthIsMet = value.length > 2; const { data, isLoading } = useSWR( - value.length > 2 ? `/example-data/states.json?s=${value}` : null, + minLengthIsMet ? `/example-data/states.json?s=${value}` : null, (url: string) => fetcher(url, value), { fallbackData: [], @@ -63,7 +64,7 @@ export const ServerSideData = (): ReactElement => { {!loading && hasResults ? data?.map((state) =>