Having an issue when attempting to populate the initial state from local storage in order to create a store. I encountered the following error message:
ReferenceError: localStorage is not defined
Here is my store configuration:
const store = createStore(reducer, {
userInfo: {
isLogged: false,
items: localStorage.getItem("@items") || []
}
})