handle empty todos
This commit is contained in:
parent
bbb7f810d1
commit
d84ef8c61b
1 changed files with 5 additions and 0 deletions
|
|
@ -152,6 +152,11 @@ class App extends Component {
|
|||
}
|
||||
renderTodos() {
|
||||
const { todos } = this.state
|
||||
|
||||
if (!todos || !todos.length) {
|
||||
return null
|
||||
}
|
||||
|
||||
return todos.map((todo, i) => {
|
||||
const { data, ref } = todo
|
||||
const id = getTodoId(todo)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue