I'm working on a React application using Redux to manage state. I've set up the Redux store and Provider in my index.js file:
1 2 3 4 5 6 7 8 9 10 |
|
In my App component, I try to use react-redux's useSelector hook to access the store:
1 2 3 4 5 6 7 8 9 10 |
|
However, this throws the following error:
1 |
|
I have confirmed:
But I still see this context not found error. What am I missing in the Provider settings to make the Redux store available to components using hooks like useSelector?
Any help is greatly appreciated!
P粉4329068802023-09-14 15:10:57
Try passing context = {null} in the provider wrapper like below
1 2 3 4 5 |
|