Skip to content

Commit

Permalink
fix: resolve initial onChange input value bug
Browse files Browse the repository at this point in the history
URL and search results don't get updated when input box value is removed after reload the page. Fix
this problem.
  • Loading branch information
satnaing committed Jan 27, 2023
1 parent 0fe14f4 commit bf4f687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/Search.tsx
Expand Up @@ -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
Expand Down

0 comments on commit bf4f687

Please sign in to comment.