handle empty todos

This commit is contained in:
DavidWells 2018-06-15 13:12:37 -07:00
parent bbb7f810d1
commit d84ef8c61b

View file

@ -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)