975 viewsMern Amazona

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.

Bassir Unselected an answer November 27, 2023

I’ve done destructured import than also it’s prompting an error.

Bassir Unselected an answer November 27, 2023

hello there,

the useContext import is incorrect. compare your code with this please:


Bassir Answered question October 13, 2022