I am trygin to use React-Redux library and I am getting the error on the title. I wrapped my components with Provider but I still get the error, only if I implement the useDispa
Happened to me, when I was calling React component as a function, without using it as virtual dom, Comp was independently called not rendered as child of some element
function Comp() {
const a = useSelector(selectA); // throws error
}
Comp();
so in my case solution was to call Comp and a component, not as a function
i.e