Below is my Header component in react: I have used ContextAPI for efficient state Management.CryptoState is used for this purpose.I have imported the state in Header and getting the necessary props using object-destructuring. Below is my Context-file: I am getting this error in Header component:Header.js:8 Un…
Tag: use-context
react context is giving undefined object
In my react application I am trying to use context api. In my component I am importing the context but it is giving error that object can not destructure the property. I am trying to implement cart functionality in my app. I am using hooks. ImgContext.js ImageGrid.js Answer You are not providing a a default v…