I think you are mutating the state at the following lines:
| constnotes=[...state.notes] |
| notes[index].completed=!note.completed |
Since each note is an object, setting notes[index].completed property is mutating the note object. Instead, we should create a new note object like this:
constnotes=[...state.notes]notes[index]={ ...state.notes[index],completed: !note.completed}
I think you are mutating the state at the following lines:
full-stack-serverless-code/graphql/src/App.js
Lines 83 to 84 in 44c4eb2
Since each
noteis an object, settingnotes[index].completedproperty is mutating thenoteobject. Instead, we should create a newnoteobject like this: