From bf4f687d2d87cfeef96141c5324d02c37766845b Mon Sep 17 00:00:00 2001 From: satnaing Date: Sat, 28 Jan 2023 00:55:30 +0630 Subject: [PATCH] fix: resolve initial onChange input value bug URL and search results don't get updated when input box value is removed after reload the page. Fix this problem. --- src/components/Search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Search.tsx b/src/components/Search.tsx index 9661181..d8e94d1 100644 --- a/src/components/Search.tsx +++ b/src/components/Search.tsx @@ -86,7 +86,7 @@ export default function SearchBar({ searchList }: Props) { placeholder="Search for anything..." type="text" name="search" - defaultValue={inputVal} + value={inputVal} onChange={handleChange} autoComplete="off" autoFocus