Skip to content

Commit 778fc4a

Browse files
committed
update: added alert feature for empty todo
1 parent b5f1585 commit 778fc4a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/App.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ function App() {
1212
}
1313

1414
function addItem() {
15-
if(!inputText) return; // removed empty todos!!
15+
if(!inputText){
16+
alert('Input Field is required!');
17+
return;
18+
}
1619
setItems(prevItems => {
1720
return [...prevItems, inputText];
1821
});

0 commit comments

Comments
 (0)