title: Null in array of objects
body: <p>So, I have a problem with REACT/REDUX, my array of objects returns a proper value but also return an undefined, and I don't know why. In redux dev tools it show's a null instead of undefined, also I have this error in console: <strong>Warning: Failed prop type: The prop <code>task</code> is marked as required in <code>NewToDo</code>, but its value is <code>undefined</code>.</strong></p>
  
  <p>Action file</p>
  
  <pre><code>import {ADD_TODO} from "./types";
  import {GET_TODO} from "./types";
  
  export const addTodo = (todo) =&gt; dispatch =&gt; {
      dispatch({
          type: ADD_TODO,
          payload: todo,
      })
  }
  
  export const getTodo = () =&gt; dispatch =&gt; {
      dispatch({
          type: GET_TODO,
      })
  }
  </code></pre>
  
  <p>Reducer </p>
  
  <pre><code>import {ADD_TODO} from "../actions/types";
  import {GET_TODO} from "../actions/types";
  
  const initialState = {
      toDos: [
          {task: 'Make a dinner', priority: '4'}
          ],
  
  };
  
  export default function(state=initialState, action){
      switch(action.type){
          case ADD_TODO:
              return{
                  ...state,
                  toDos: [action.payload, ...state.toDos]
              }
          case GET_TODO:
              return {
                  ...state,
              }
          default:
              return state;
      }
  }
  </code></pre>
  
  <p>A component that renders the tasks</p>
  
  <pre><code>import React, {Component} from 'react';
  import PropTypes from 'prop-types';
  import {connect} from 'react-redux'
  class NewToDo extends Component {
      render() {
          console.log(this.props.task)
  
              return (
                  &lt;div&gt;
                  &lt;/div&gt;
              );
          }
      }
  
  
  NewToDo.propTypes = {
      task: PropTypes.object.isRequired,
  };
  
  export default NewToDo;
  </code></pre>
  
  <p>A component with all toDos </p>
  
  <pre><code>import React, {Component} from 'react';
  import PropTypes from 'prop-types';
  import NewToDo from './newToDo'
  import {getTodo} from "../../actions/toDoActions";
  import {connect} from 'react-redux'
  class ToDos extends Component {
      componentDidMount(){
          this.props.getTodo();
      }
  
      render() {
          const {toDos} = this.props;
          console.log(toDos)
          return (
              &lt;div&gt;
                  {toDos.map( todo =&gt; (
                      &lt;NewToDo task={todo}/&gt;
                  ))}
  
              &lt;/div&gt;
          );
      }
  }
  
  
  ToDos.propTypes = {
      toDos: PropTypes.array.isRequired,
      getTodo: PropTypes.func.isRequired,
  
  
  }
  
  const mapStateToProps = (state) =&gt; ({
      toDos: state.toDo.toDos
  })
  
  export default connect(mapStateToProps, {getTodo})(ToDos);
  </code></pre>