score:2

Accepted answer
      let filteredState = { todo: [], visibilityFilter: ''};
      if(this.props.visibilityFilter == SHOW_ACTIVE){
        filteredState.todo = this.props.todo.filter( item => !item.completed )
      }
      if(this.props.visibilityFilter == SHOW_COMPLETED){
        filteredState.todo = this.props.todo.filter( item => item.completed )
      }
      if(this.props.visibilityFilter == SHOW_ALL_TODO){
        filteredState.todo = this.props.todo;
      }

      return (
        <ToDoItem todo={filteredState} />
      )

Related Query

More Query from same tag