Problem while using state from React-Redux ___ Property 'cart' does not exist on type 'DefaultRootState' - from a MERN project

Viewed 121

the error i am getting as per VS Code is --- Property 'productDetails' does not exist on type 'DefaultRootState'

to more elaborate the problem as follows, I have tried the solutions given on the page, however none worked for me. so my problem is as follows:

//While I am using 

const productList = useSelector((state) => state.productList)  

//I am getting that property does not exist. the codes can be seen from the below images

this is the store.js file

And this is the file where I am trying to use > const productList = useSelector((state) => state.productList

the error can be clearly seen in the second image Property 'cart' does not exist on type 'DefaultRootState'.ts(2339)

this is a MERN Project.

0 Answers
Related