I am getting this error when using the useState hook. I have this in it\'s basic form, looking at the react docs for a reference, but am still getting this erro
For fellow users of yarn workspaces, here's my situation and how I figured it out.
The Facebook docs on Invalid Hook Call Warning say nothing about yarn workspaces, so I assumed my config was correct. But it wasn't. You can fix the error only by using the same version across all your packages.
In the example above, you have to bump the version of react from "foo" to 16.10.1, so that it matches the react version from "bar".
Bonus: see this discussion on GitHub for a beautiful collection of emotional baggage offloaded on the Internet.