You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spoke last week about having as little state as possible and deriving data you need for your UI from the it. This is an example of that, let me know if that makes sense!
The text was updated successfully, but these errors were encountered:
You don't need this state, you can just derive it from what's in local storage
week6-missmacs/pages/index.js
Line 21 in 7cd5ff6
So something like
const itemsInBasket = JSON.parse(localStorage.getItem("basket")).length
I spoke last week about having as little state as possible and deriving data you need for your UI from the it. This is an example of that, let me know if that makes sense!
The text was updated successfully, but these errors were encountered: