Navigating through the code I found that you are not returning the right value on this function. I tried loading what is your initialState on the local storage under the key "state" and it worked perfectly.
So the correct solution would be
const [state, dispatch] = useReducer(AppReducer, initialState, (emptyState) => {
const localData = localStorage.getItem('state');
return localData ? JSON.parse(localData) : emptyState;
});
I think that the main issue is related to the fact that you are expecting an object with the transaction's key but instead you are passing an empty array.
Please, let me know if it doesn't work. I'll be glad to help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…