I can update my todo list in UI and it's replacing prev value to new value.
const { prev, newValue} = action.payload;
return Object.assign({}, state, { toDoList: state.toDoList.map(i => i !== prev ? i : newValue)});
However, I can't do the same thing in localStorage.
const storageItems = JSON.parse(localStorage.getItem("todos"));
storageItems.map(i => i !== prev ? i : newValue);
localStorage.setItem("todos", JSON.stringify(storageItems));
storageItems array is not updating I don't know why.
Is updating local storage different ? How can we update the storage?