react-ecommerce
react-ecommerce copied to clipboard
Persist cart on refresh
Addresses #2
I'd love some feedback on this one, if possible. I wasn't sure if I should put updating localStorage in an onClick() or whether to use a useEffect. Using the onClick method, at least the way I was implementing it, would mean I'd have to have the same code in two locations, but onEffect reads from disk more than I think is necessary. (I added some comments in the code)
Hi @mattpauls 👋
I see you've completed 3/5ths of the issues. Let me know if you need any help!