node-react-ecommerce
node-react-ecommerce copied to clipboard
TypeError: Cannot destructure property 'loading' of 'userUpdate' as it is undefined.
21 | dispatch(update({ userId: userInfo._id, email, name, password })) 22 | } 23 | const userUpdate = useSelector(state => state.userUpdate);
24 | const { loading, success, error } = userUpdate; | ^ 25 | 26 | const myOrderList = useSelector(state => state.myOrderList); 27 | const { loading: loadingOrders, orders, error: errorOrders } = myOrderList;
It means that state.userUpdate is undefined. Check the reducer to see if you initialize it or not.
Had the same problem, but with userRegister. With userRegisterReducer.js was all okey, but needed to import and add it to combineReducers({...}) in store.js. Now all works.