We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
待辦事項刪到0時,不能再新增,這是因為todo item元件全部移除的關係嗎? 該如何解呢? 感謝您的協助
The text was updated successfully, but these errors were encountered:
Hi @leo424y,
其實前陣子我有發現這個 bug 🐞, 但是一直沒去修它!
問題出現在下面:
const _createTodo = (todos, title) => { todos.push({ id: todos[todos.length - 1].id + 1, // 這裡會爆掉,因為已經沒有上一個 todo 了! title, completed: false }); return todos; };
所以你可以修正為
{ id: todos[todos.length - 1] ? (todos[todos.length - 1].id + 1) : 0 }
最後,還是感謝你的回覆! 😀
Sorry, something went wrong.
感謝您,問題已解
shiningjason
No branches or pull requests
待辦事項刪到0時,不能再新增,這是因為todo item元件全部移除的關係嗎? 該如何解呢? 感謝您的協助
The text was updated successfully, but these errors were encountered: