為何我在做物件刪除時會發生這個錯誤?
×
TypeError: Cannot convert undefined or null to object
deleteItem
src/App.js:22
19 | }
20 | this.actions = {
21 | deleteItem: (item) => {
> 22 | delete this.state.items[item.id]
| ^ 23 | this.setState({
24 | items: this.state.items
25 | })