We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9de815d commit a65ddaaCopy full SHA for a65ddaa
react-todos/src/App.js
@@ -11,13 +11,13 @@ function App() {
11
const [todos, setTodos] = useState(seededTodos);
12
13
const addTodo = () => {
14
- if (todos.length > 0) {
+ if (seededTodos.length > 0) {
15
const newTodo = {
16
rowNumber: todos.length + 1,
17
rowDescription: "New todo",
18
rowAssigned: "User Three",
19
};
20
- setTodos(newTodo);
+ setTodos(todos => [...todos, newTodo])
21
}
22
23
0 commit comments