title: A state mutation was detected between dispatches but I haven't mutated state
body: <p>I know this question has been asked before, but in almost all of them talk about the OP mutating the state directly, which I've tried to avoid using techniques like the spread operator (in both objects and arrays) but in spite of that I'm getting the following error:</p>
  
  <pre><code>Uncaught Error: A state mutation was detected between dispatches, in the path `courses.0`. This may cause incorrect behavior. (http://redux.js.org/docs/Troubleshooting.html#never-mutate-reducer-arguments)
    at invariant (eval at &lt;anonymous&gt; (bundle.js:922), &lt;anonymous&gt;:40:15)
    at eval (eval at &lt;anonymous&gt; (bundle.js:3825), &lt;anonymous&gt;:50:36)
    at eval (eval at &lt;anonymous&gt; (bundle.js:3846), &lt;anonymous&gt;:14:16)
    at dispatch (eval at &lt;anonymous&gt; (bundle.js:3853), &lt;anonymous&gt;:37:18)
    at eval (eval at &lt;anonymous&gt; (bundle.js:1151), &lt;anonymous&gt;:63:5)
    at eval (eval at &lt;anonymous&gt; (bundle.js:3846), &lt;anonymous&gt;:11:18)
    at Object.eval [as saveCourse] (eval at &lt;anonymous&gt; (bundle.js:3860), &lt;anonymous&gt;:4:12)
    at Object.ManageCoursePage._this.saveCourse [as onSave] (eval at &lt;anonymous&gt; (bundle.js:2080), &lt;anonymous&gt;:134:27)
    at CourseForm._this.onHandleSave (eval at &lt;anonymous&gt; (bundle.js:2052), &lt;anonymous&gt;:93:19)
    at Object.ReactErrorUtils.invokeGuardedCallback (eval at &lt;anonymous&gt; (bundle.js:1301), &lt;anonymous&gt;:69:16)
  </code></pre>
  
  <p>I read <a href="http://redux.js.org/docs/Troubleshooting.html#never-mutate-reducer-arguments" rel="nofollow noreferrer">the article that the error points to</a>, and as it suggests I checked if I was manually mutating the state in my reducer and I can't see where that could be happening:</p>
  
  <pre><code>const courseReducer = (state = initialState.courses, action) =&gt; {
    switch (action.type) {
      case types.LOAD_COURSE_SUCCESS:
        return action.courses;
      case types.CREATE_COURSE_SUCCESS:
      //This action throw the error 
        debugger;      
        return [
          ...state,
          Object.assign({}, action.course)
        ];
      case types.UPDATE_COURSE_SUCCESS:
       //This action throw the error
        debugger;
        return [
          ...state.filter(course =&gt; course.id !== action.course.id),
          Object.assign({}, action.course)
        ];
      case types.DELETE_COURSE_SUCCESS:
        return [...state.filter(course =&gt; course.id !== action.courseId)];
      default:
        return state;
    }
  };
  </code></pre>
  
  <p>Here's <a href="https://codesandbox.io/embed/zmY3z39p7" rel="nofollow noreferrer">a sandbox with part of the application</a> that can be used to replicate the error, which weirdly only happens from times to times when I create a new course or try to edit an existing one (actions <code>CREATE_COURSE_SUCCESS</code> and <code>UPDATE_COURSE_SUCCESS</code>respectively in my <code>courseReducer</code>)</p>
  
  <p><a href="https://codesandbox.io/s/zmY3z39p7" rel="nofollow noreferrer"><img src="https://codesandbox.io/static/img/play-codesandbox.svg" alt="Edit React-Redux(Question) - Challenges"></a></p>
  
  <p><a href="https://i.stack.imgur.com/l0QVa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/l0QVa.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/x7RRA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x7RRA.png" alt="enter image description here"></a></p>
  
  <p>I'd really appreciate if anyone could help me figure out where could be lying the source of this error.</p>