So I’ve been wanting to build a quite simple e-commerce website using react and I’ve run into this bug where whenever I would click the add to cart button it would give an error saying that the basket is undefined(I’ve tried to figure out why it would become undefined but just cant). I’ve looked everywhere for answers but can’t find any. Any help would be much appreciated.
On the production build it would only appear as a blank screen
Edit – Solved, thanks to u/floppycrackers