Error when using token useState variable but running when using localStorage.getItem(“token”)
Can anyone explain me
why await loadCartData(localStorage.getItem(“token”));
this works properly but when I use
await loadCartData(token);
it dosent work and gives an error
TypeError: Cannot read properties of undefined (reading ’66c1f742ebf65ca0bceabd04′)