Skip to content

Commit

Permalink
Merge pull request #13 from caroluxurians/#-4
Browse files Browse the repository at this point in the history
value is not reset on add
  • Loading branch information
rostaklein authored Apr 4, 2024
2 parents 34865be + a7eafa4 commit 82ae8ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/app/components/add-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type Props = {

export function AddItem({ onAddItem: addItem }: Props) {
const [value, setValue] = useState('');

const handleOnValueChange = (value: string) => {
setValue(value);
};
Expand All @@ -18,6 +19,7 @@ export function AddItem({ onAddItem: addItem }: Props) {
if (value !== '') {
addItem(value);
}
setValue('');
};

return (
Expand Down

0 comments on commit 82ae8ac

Please sign in to comment.