Why does my Redux reducer think my state is undefined?
问题 I believe I'm copying the Todo tutorial pretty much line for line, I am getting this error: Error: Reducer "addReport" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. And here is my addReport reducer: const addReport = (state = [], action) => { console.log(state) switch (action.type) { case ADD_NEW_REPORT: return [...state, addReports(undefined, action) ] } } I