Hello Basir,
I am following your MERN Tutorial uploaded on your youtube channel named *Coding with Basir* and the video link: “https://www.youtube.com/watch?v=CDtPMR5y0QU&ab_channel=CodingwithBasir”. when I am doing the add-to-cart operation I am getting an error and the project is not loading. the error appears on the console of the browser error message as follows
“Uncaught TypeError: Cannot destructure property ‘state’ of ‘(0 , react__WEBPACK_IMPORTED_MODULE_3__.useContext)(…)’ as it is undefined.”
as my code and your code are just the same.
I’ve done destructured import than also it’s prompting an error.
hello there,
the useContext import is incorrect. compare your code with this please:
https://github.com/basir/mern-amazona/blob/master/frontend/src/screens/CartScreen.js#L1